This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
Re: [patch 4/7] Cygwin/X: Invent a scan code if we dont have one
Reini Urban wrote:
Shouldn't we properly attribute Paul Loewenstein at least in the patch
who came up with this idea.
Indeed, thanks for pointing out this oversight.
Revised patch attached.
That's what happens to people who don't use diff :-)
Cygwin/X: Invent a scan code if we don't 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
Based on an original patch by Paul Loewenstein <paul.loewenstein@gmail.com>
---
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/