diff options
author | marha <marha@users.sourceforge.net> | 2009-11-16 13:46:01 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-11-16 13:46:01 +0000 |
commit | 578938f1cdd5a06dd6fa28167d575ec980322a5d (patch) | |
tree | e31cf77fab7cc6e005b0e726e7951d7eef79550f /xorg-server/hw/xwin/winkeybd.c | |
parent | 0032f9b66d63a4b1c5222edb8603fb60da379fb0 (diff) | |
download | vcxsrv-578938f1cdd5a06dd6fa28167d575ec980322a5d.tar.gz vcxsrv-578938f1cdd5a06dd6fa28167d575ec980322a5d.tar.bz2 vcxsrv-578938f1cdd5a06dd6fa28167d575ec980322a5d.zip |
Update to git master branch of xserver.
Diffstat (limited to 'xorg-server/hw/xwin/winkeybd.c')
-rw-r--r-- | xorg-server/hw/xwin/winkeybd.c | 25 |
1 files changed, 23 insertions, 2 deletions
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; |