Handle emulated keyboard input that arrives as VK_PACKET

Fixes bug #642772. Thanks to the anonymous bug reporter for providing
a test program.
This commit is contained in:
Tor Lillqvist 2011-02-20 01:39:13 +02:00
parent 50233edbc9
commit 8e6932f46e

View File

@ -1958,12 +1958,16 @@ gdk_event_translate (MSG *msg,
build_key_event_state (event, key_state);
gdk_keymap_translate_keyboard_state (_gdk_win32_display_get_keymap (_gdk_display),
event->key.hardware_keycode,
event->key.state,
event->key.group,
&event->key.keyval,
NULL, NULL, NULL);
if (msg->wParam == VK_PACKET &&
ToUnicode (VK_PACKET, HIWORD (msg->lParam), key_state, wbuf, 1, 0) == 1)
event->key.keyval = gdk_unicode_to_keyval (wbuf[0]);
else
gdk_keymap_translate_keyboard_state (_gdk_win32_display_get_keymap (_gdk_display),
event->key.hardware_keycode,
event->key.state,
event->key.group,
&event->key.keyval,
NULL, NULL, NULL);
fill_key_event_string (event);