Aric Stewart : winex11.drv: Make sure keyboard state is up to date before processing GetAsyncKeyState.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Mar 1 16:27:00 CST 2007


Module: wine
Branch: master
Commit: 4f944f7f01102218f5b7fde24bf140d56b39dae1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4f944f7f01102218f5b7fde24bf140d56b39dae1

Author: Aric Stewart <aric at codeweavers.com>
Date:   Tue Feb 27 20:28:28 2007 +0900

winex11.drv: Make sure keyboard state is up to date before processing GetAsyncKeyState.

---

 dlls/winex11.drv/keyboard.c |    8 ++++++--
 dlls/winex11.drv/x11drv.h   |    2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index c025a38..7fbbca8 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1835,8 +1835,12 @@ void X11DRV_InitKeyboard(void)
  */
 SHORT X11DRV_GetAsyncKeyState(INT key)
 {
-    SHORT retval = ((key_state_table[key] & 0x40) ? 0x0001 : 0) |
-                   ((key_state_table[key] & 0x80) ? 0x8000 : 0);
+    SHORT retval;
+
+    X11DRV_MsgWaitForMultipleObjectsEx( 0, NULL, 0, QS_KEY, 0 );
+
+    retval = ((key_state_table[key] & 0x40) ? 0x0001 : 0) |
+             ((key_state_table[key] & 0x80) ? 0x8000 : 0);
     key_state_table[key] &= ~0x40;
     TRACE_(key)("(%x) -> %x\n", key, retval);
     return retval;
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 8f2c984..8012d3b 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -673,6 +673,8 @@ extern void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD dwFlags, DWO
                                         DWORD dwExtraInfo, UINT injected_flags );
 extern void X11DRV_send_mouse_input( HWND hwnd, DWORD flags, DWORD x, DWORD y,
                                      DWORD data, DWORD time, DWORD extra_info, UINT injected_flags );
+extern DWORD X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
+                                                 DWORD mask, DWORD flags );
 
 typedef int (*x11drv_error_callback)( Display *display, XErrorEvent *event, void *arg );
 




More information about the wine-cvs mailing list