This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
[patch 4/7] Cygwin/X: Invent a scan code if we dont have one
- From: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- To: cygwin-xfree at cygwin dot com
- Cc: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- Date: Thu, 15 Jan 2009 21:05:27 +0000
- Subject: [patch 4/7] Cygwin/X: Invent a scan code if we dont have one
- References: <20090115210523.297875000@dronecode.org.uk>
- Reply-to: cygwin-xfree at cygwin dot com
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/