X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/453296e78b939b788da62fc4547aef70fcc909a8..ccec90930cfc38bd4347a97f46481242d9fd23cd:/src/osx/uiaction_osx.cpp diff --git a/src/osx/uiaction_osx.cpp b/src/osx/uiaction_osx.cpp index c2ebb321b3..7a537e1f3b 100644 --- a/src/osx/uiaction_osx.cpp +++ b/src/osx/uiaction_osx.cpp @@ -4,7 +4,7 @@ // Author: Kevin Ollivier, Steven Lamerton, Vadim Zeitlin // Modified by: // Created: 2010-03-06 -// RCS-ID: $Id: menu.cpp 54129 2008-06-11 19:30:52Z SC $ +// RCS-ID: $Id$ // Copyright: (c) Kevin Ollivier // (c) 2010 Steven Lamerton // (c) 2010 Vadim Zeitlin @@ -60,17 +60,6 @@ CGPoint GetMousePosition() return pos; } -bool SendCharCode(CGKeyCode keycode, bool isDown) -{ - wxCFRef - event(CGEventCreateKeyboardEvent(NULL, keycode, isDown)); - if ( !event ) - return false; - - CGEventPost(kCGHIDEventTap, event); - return true; -} - CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) { CGKeyCode keycode; @@ -239,32 +228,17 @@ bool wxUIActionSimulator::MouseUp(int button) return true; } -bool wxUIActionSimulator::DoKey(int keycode, int modifiers, bool isDown) +bool +wxUIActionSimulator::DoKey(int keycode, int WXUNUSED(modifiers), bool isDown) { - if (isDown) - { - if (modifiers & wxMOD_SHIFT) - SendCharCode(kVK_Shift, true); - if (modifiers & wxMOD_ALT) - SendCharCode(kVK_Option, true); - if (modifiers & wxMOD_CMD) - SendCharCode(kVK_Command, true); - } - CGKeyCode cgcode = wxCharCodeWXToOSX((wxKeyCode)keycode); - if ( !SendCharCode(cgcode, isDown) ) - return false; - if(!isDown) - { - if (modifiers & wxMOD_SHIFT) - SendCharCode(kVK_Shift, false); - if (modifiers & wxMOD_ALT) - SendCharCode(kVK_Option, false); - if (modifiers & wxMOD_CMD) - SendCharCode(kVK_Command, false); - } + wxCFRef + event(CGEventCreateKeyboardEvent(NULL, cgcode, isDown)); + if ( !event ) + return false; + CGEventPost(kCGHIDEventTap, event); return true; }