Patch: Add F17-F32 handling to X11 keyboard driver

Peter Seebach seebs at plethora.net
Tue Jan 23 13:05:15 CST 2007


This patch extends the existing function key support from 16 to 32 function
keys.  F25-F32 have no corresponding scan codes, but have valid vKey values
(found buried on a website somewhere).  F17-F24 have corresponding scan
codes, now updated in the corresponding table.  This has been tested lightly
to send key codes that Windows apps recognize sometimes, although not all
Windows apps recognize these keys to begin with.  It shouldn't break anything,
at least.

ChangeLog entry:

2007-01-23  Peter Seebach <seebs at seebs.net>

	* include/winuser.h:
	Add VK_F25 through VK_F32 definitions (conveniently, they are the
	8 "unused" values immediately after F1-F24)

	* dlls/winex11.drv/keyboard.c:
	Add VK_F17-VK_F32 to vkey table, scan codes for F17-F24 to scan code
	table, and corresponding check for function key scan codes in a lookup
	table fudge.

--- wine-0.9.29/dlls/winex11.drv/keyboard.c	2007-01-09 09:42:47.000000000 -0600
+++ wine-0.9.29.patch/dlls/winex11.drv/keyboard.c	2007-01-23 12:41:52.000000000 -0600
@@ -1020,9 +1020,9 @@
     /* function keys */
     VK_F1, VK_F2,
     VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10,    /* FFC0 */
-    VK_F11, VK_F12, VK_F13, VK_F14, VK_F15, VK_F16, 0, 0,       /* FFC8 */
-    0, 0, 0, 0, 0, 0, 0, 0,                                     /* FFD0 */
-    0, 0, 0, 0, 0, 0, 0, 0,                                     /* FFD8 */
+    VK_F11, VK_F12, VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18,  /* FFC8 */
+    VK_F19, VK_F20, VK_F21, VK_F22, VK_F23, VK_F24, VK_F25, VK_F26,  /* FFD0 */
+    VK_F27, VK_F28, VK_F29, VK_F30, VK_F31, VK_F32, 0, 0,       /* FFD8 */
     /* modifier keys */
     0, VK_SHIFT, VK_SHIFT, VK_CONTROL,                          /* FFE0 */
     VK_CONTROL, VK_CAPITAL, 0, VK_MENU,
@@ -1066,8 +1066,8 @@
     /* function keys */
     0x3B, 0x3C,
     0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44,              /* FFC0 */
-    0x57, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* FFC8 */
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* FFD0 */
+    0x57, 0x58, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,              /* FFC8 */
+    0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x76, 0x00, 0x00,              /* FFD0 */
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* FFD8 */
     /* modifier keys */
     0x00, 0x2A, 0x36, 0x1D, 0x11D, 0x3A, 0x00, 0x38,             /* FFE0 */
@@ -1465,7 +1465,7 @@
 	if ( event->type == KeyRelease ) dwFlags |= KEYEVENTF_KEYUP;
 	if ( vkey & 0x100 )              dwFlags |= KEYEVENTF_EXTENDEDKEY;
 
-        X11DRV_send_keyboard_input( vkey & 0xff, bScan, dwFlags, event_time, 0, 0 );
+	X11DRV_send_keyboard_input( vkey & 0xff, bScan, dwFlags, event_time, 0, 0 );
     }
    }
 }
@@ -2253,8 +2253,10 @@
             function keys. Soooo.. We will leave the table alone and
             fudge the lookup here till the other part is found and fixed!!! */
 
-  if ( ((scanCode >= 0x13b) && (scanCode <= 0x144)) ||
-       (scanCode == 0x157) || (scanCode == 0x158))
+  if (((scanCode >= 0x13b) && (scanCode <= 0x144)) ||
+      ((scanCode >= 0x164) && (scanCode <= 0x16e)) ||
+       (scanCode == 0x157) || (scanCode == 0x158)  ||
+       (scanCode == 0x176))
     scanCode &= 0xff;   /* remove "extended-key" flag for Fx keys */
 
   /* let's do scancode -> keycode -> keysym -> String */
--- wine-0.9.29/include/winuser.h	2007-01-09 09:42:47.000000000 -0600
+++ wine-0.9.29.patch/include/winuser.h	2007-01-22 13:56:34.000000000 -0600
@@ -3595,7 +3595,14 @@
 #define VK_F22              0x85
 #define VK_F23              0x86
 #define VK_F24              0x87
-/*                          0x88-0x8F  Unassigned */
+#define VK_F25              0x88
+#define VK_F26              0x89
+#define VK_F27              0x8A
+#define VK_F28              0x8B
+#define VK_F29              0x8C
+#define VK_F30              0x8D
+#define VK_F31              0x8E
+#define VK_F32              0x8F
 #define VK_NUMLOCK          0x90
 #define VK_SCROLL           0x91
 #define VK_OEM_NEC_EQUAL    0x92



More information about the wine-patches mailing list