winex11: Use constants instead of magic numbers in GetKeyNameText.

This commit is contained in:
Vitaliy Margolen 2008-04-26 17:35:47 -06:00 committed by Alexandre Julliard
parent 964687d7c3
commit 56989b6ed0

View File

@ -2158,8 +2158,7 @@ INT X11DRV_GetKeyNameText(LONG lParam, LPWSTR lpBuffer, INT nSize)
scanCode = lParam >> 16;
scanCode &= 0x1ff; /* keep "extended-key" flag with code */
/* FIXME: should use MVK type 3 (NT version that distinguishes right and left */
vkey = X11DRV_MapVirtualKeyEx(scanCode, 1, X11DRV_GetKeyboardLayout(0));
vkey = X11DRV_MapVirtualKeyEx(scanCode, MAPVK_VSC_TO_VK_EX, X11DRV_GetKeyboardLayout(0));
/* handle "don't care" bit (0x02000000) */
if (!(lParam & 0x02000000)) {
@ -2181,7 +2180,7 @@ INT X11DRV_GetKeyNameText(LONG lParam, LPWSTR lpBuffer, INT nSize)
}
}
ansi = X11DRV_MapVirtualKeyEx(vkey, 2, X11DRV_GetKeyboardLayout(0));
ansi = X11DRV_MapVirtualKeyEx(vkey, MAPVK_VK_TO_CHAR, X11DRV_GetKeyboardLayout(0));
TRACE("scan 0x%04x, vkey 0x%04x, ANSI 0x%04x\n", scanCode, vkey, ansi);
/* first get the name of the "regular" keys which is the Upper case