diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 882b98cd80e..6aa613fc78e 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1242,23 +1242,22 @@ void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD event_flags, DWORD * Updates internal state for , depending on key under X * */ -static inline void KEYBOARD_UpdateOneState ( int vkey, int state, DWORD time ) +static inline void KEYBOARD_UpdateOneState ( WORD vkey, WORD scan, int state, DWORD time ) { /* Do something if internal table state != X state for keycode */ - if (((key_state_table[vkey] & 0x80)!=0) != state) + if (((key_state_table[vkey & 0xff] & 0x80)!=0) != state) { - DWORD flags = 0; + DWORD flags = vkey & 0x100 ? KEYEVENTF_EXTENDEDKEY : 0; if (!state) flags |= KEYEVENTF_KEYUP; - if (vkey == VK_RSHIFT || vkey == VK_RCONTROL || vkey == VK_RMENU) flags |= KEYEVENTF_EXTENDEDKEY; TRACE("Adjusting state for vkey %#.2x. State before %#.2x\n", - vkey, key_state_table[vkey]); + vkey, key_state_table[vkey & 0xff]); /* Fake key being pressed inside wine */ - X11DRV_send_keyboard_input( vkey, 0, flags, time, 0, 0 ); + X11DRV_send_keyboard_input( vkey & 0xff, scan & 0xff, flags, time, 0, 0 ); - TRACE("State after %#.2x\n",key_state_table[vkey]); + TRACE("State after %#.2x\n", key_state_table[vkey & 0xff]); } } @@ -1273,7 +1272,7 @@ static inline void KEYBOARD_UpdateOneState ( int vkey, int state, DWORD time ) */ void X11DRV_KeymapNotify( HWND hwnd, XEvent *event ) { - int i, j, alt_r = 0, alt_l = 0, control_r = 0, control_l = 0, shift_r = 0, shift_l = 0; + int i, j; DWORD time = GetCurrentTime(); /* the minimum keycode is always greater or equal to 8, so we can @@ -1281,27 +1280,25 @@ void X11DRV_KeymapNotify( HWND hwnd, XEvent *event ) */ for (i = 1; i < 32; i++) { - if (!event->xkeymap.key_vector[i]) continue; for (j = 0; j < 8; j++) { - if (!(event->xkeymap.key_vector[i] & (1<xkeymap.key_vector[i] & (1<