From 4f944f7f01102218f5b7fde24bf140d56b39dae1 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Tue, 27 Feb 2007 20:28:28 +0900 Subject: [PATCH] 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 c025a3820ec..7fbbca84f59 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 8f2c9843d0f..8012d3b1b39 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 );