GDK W32: Special handling for VK_PAUSE

Similar to VK_DIVIDE, this key can't be mapped to a scancode by
MapVirtualKeyEx(). Googling suggests that this is a known bug.

https://bugzilla.gnome.org/show_bug.cgi?id=769214
This commit is contained in:
Руслан Ижбулатов 2016-07-27 18:05:10 +00:00
parent e1240b42ed
commit 33442d953d

View File

@ -699,8 +699,13 @@ update_keymap (GdkKeymap *gdk_keymap)
scancode = MapVirtualKeyEx (vk, 0, hkls[group]); scancode = MapVirtualKeyEx (vk, 0, hkls[group]);
keygroup = &keymap->keysym_tab[(vk * hkls_len + group) * GDK_WIN32_LEVEL_COUNT]; keygroup = &keymap->keysym_tab[(vk * hkls_len + group) * GDK_WIN32_LEVEL_COUNT];
/* MapVirtualKeyEx() fails to produce a scancode for VK_DIVIDE and VK_PAUSE.
* Ignore that, handle_special() will figure out a Gdk keyval for these
* without needing a scancode.
*/
if (scancode == 0 && if (scancode == 0 &&
vk != VK_DIVIDE) vk != VK_DIVIDE &&
vk != VK_PAUSE)
{ {
for (level = GDK_WIN32_LEVEL_NONE; level < GDK_WIN32_LEVEL_COUNT; level++) for (level = GDK_WIN32_LEVEL_NONE; level < GDK_WIN32_LEVEL_COUNT; level++)
keygroup[level] = GDK_KEY_VoidSymbol; keygroup[level] = GDK_KEY_VoidSymbol;