This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch 4/7] Cygwin/X: Invent a scan code if we dont have one


Apparently, fake keypresses generated by speech recognizers may not bother
with a scan code, so look up what scan code corresponds to the virtual key
code if this occurs

---
 xserver/hw/xwin/winkeybd.c |    7 +++++++
 1 file changed, 7 insertions(+)

Index: xorg-server-1.5.3/xserver/hw/xwin/winkeybd.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winkeybd.c	2009-01-13 17:24:09.359375000 +0000
+++ xorg-server-1.5.3/xserver/hw/xwin/winkeybd.c	2009-01-14 00:25:02.703125000 +0000
@@ -80,6 +80,13 @@
   int		iKeyFixupEx = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 2];
   int		iParamScanCode = LOBYTE (HIWORD (lParam));
 
+  /* WM_ key messages faked by speech recognizers don't have a scan code... */
+  if (iParamScanCode == 0)
+    {
+      ErrorF("winTranslateKey: No scancode, looking it up...\n");
+      iParamScanCode = MapVirtualKeyEx(wParam, /*MAPVK_VK_TO_VSC*/0, GetKeyboardLayout(0));
+    }
+
   /* Branch on special extended, special non-extended, or normal key */
   if ((HIWORD (lParam) & KF_EXTENDED) && iKeyFixupEx)
     *piScanCode = iKeyFixupEx;

-- 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]