From 578938f1cdd5a06dd6fa28167d575ec980322a5d Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 16 Nov 2009 13:46:01 +0000 Subject: Update to git master branch of xserver. --- xorg-server/hw/xwin/winkeybd.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'xorg-server/hw/xwin/winkeybd.c') diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c index 611ea5d55..317f14dff 100644 --- a/xorg-server/hw/xwin/winkeybd.c +++ b/xorg-server/hw/xwin/winkeybd.c @@ -73,10 +73,31 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode) { int iKeyFixup = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 1]; int iKeyFixupEx = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 2]; - int iParamScanCode = LOBYTE (HIWORD (lParam)); + int iParam = HIWORD (lParam); + int iParamScanCode = LOBYTE (iParam); + +/* WM_ key messages faked by Vista speech recognition (WSR) don't have a + * scan code. + * + * Vocola 3 (Rick Mohr's supplement to WSR) uses + * System.Windows.Forms.SendKeys.SendWait(), which appears always to give a + * scan code of 1 + */ + if (iParamScanCode <= 1) + { + if (VK_PRIOR <= wParam && wParam <= VK_DOWN) + /* Trigger special case table to translate to extended + * keycode, otherwise if num_lock is on, we can get keypad + * numbers instead of navigation keys. */ + iParam |= KF_EXTENDED; + else + 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) + if ((iParam & KF_EXTENDED) && iKeyFixupEx) *piScanCode = iKeyFixupEx; else if (iKeyFixup) *piScanCode = iKeyFixup; -- cgit v1.2.3