GDK W32: Special handling for VK_PAUSE
authorРуслан Ижбулатов <lrn1986@gmail.com>
Wed, 27 Jul 2016 18:05:10 +0000 (18:05 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Mon, 9 Jan 2017 15:15:52 +0000 (15:15 +0000)
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

gdk/win32/gdkkeys-win32.c

index e151a8e64e53bd1612b0df204ae47c922765b4fc..7217403c5b7e744ad1e3b764ac48bfb2302c402a 100644 (file)
@@ -699,8 +699,13 @@ update_keymap (GdkKeymap *gdk_keymap)
           scancode = MapVirtualKeyEx (vk, 0, hkls[group]);
           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 &&
-              vk != VK_DIVIDE)
+              vk != VK_DIVIDE &&
+              vk != VK_PAUSE)
             {
               for (level = GDK_WIN32_LEVEL_NONE; level < GDK_WIN32_LEVEL_COUNT; level++)
                 keygroup[level] = GDK_KEY_VoidSymbol;