]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/uiaction.cpp
Set the correct svn properties on the new files. Correct a minor date typo.
[wxWidgets.git] / src / msw / uiaction.cpp
index d8f498cbd8165137c86dccea285d42e027d1ca59..eb5bfd1e34567522b04efbf19496fce891cdd85b 100644 (file)
 #if wxUSE_UIACTIONSIMULATOR
 
 #include "wx/uiaction.h"
-#include "wx/window.h" //for wxCharCodeWXToMSW
 #include "wx/msw/wrapwin.h"
 
+#include "wx/msw/private/keyboard.h"
+
 namespace
 {
 
@@ -74,8 +75,16 @@ bool wxUIActionSimulator::MouseUp(int button)
 bool
 wxUIActionSimulator::DoKey(int keycode, int WXUNUSED(modifiers), bool isDown)
 {
-    DWORD vkkeycode = wxCharCodeWXToMSW(keycode);
-    keybd_event(vkkeycode, 0, isDown ? 0 : KEYEVENTF_KEYUP, 0);
+    bool isExtended;
+    DWORD vkkeycode = wxMSWKeyboard::WXToVK(keycode, &isExtended);
+
+    DWORD flags = 0;
+    if ( isExtended )
+        flags |= KEYEVENTF_EXTENDEDKEY;
+    if ( !isDown )
+        flags |= KEYEVENTF_KEYUP;
+
+    keybd_event(vkkeycode, 0, flags, 0);
 
     return true;
 }