Vitaliy Margolen : winex11: Use constants instead of magic numbers in GetKeyNameText.

Alexandre Julliard julliard at winehq.org
Mon Apr 28 08:01:10 CDT 2008


Module: wine
Branch: master
Commit: 56989b6ed030f37162623e45f0a65612929968e3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=56989b6ed030f37162623e45f0a65612929968e3

Author: Vitaliy Margolen <wine-patches at kievinfo.com>
Date:   Sat Apr 26 17:35:47 2008 -0600

winex11: Use constants instead of magic numbers in GetKeyNameText.

---

 dlls/winex11.drv/keyboard.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index b2f2522..917cc2e 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -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




More information about the wine-cvs mailing list