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

This commit is contained in:
Aric Stewart 2007-02-27 20:28:28 +09:00 committed by Alexandre Julliard
parent abfe105c2f
commit 4f944f7f01
2 changed files with 8 additions and 2 deletions

View File

@ -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;

View File

@ -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 );