Aric Stewart : winex11: Strip the _L or _R from X11DRV_GetKeyNameText when appropriate.

Alexandre Julliard julliard at winehq.org
Mon Jan 23 13:01:13 CST 2012


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Fri Jan 20 14:07:05 2012 -0600

winex11: Strip the _L or _R from X11DRV_GetKeyNameText when appropriate.

---

 dlls/winex11.drv/keyboard.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index c561102..160b986 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -2301,6 +2301,24 @@ INT CDECL X11DRV_GetKeyNameText(LONG lParam, LPWSTR lpBuffer, INT nSize)
       keys = keycode_to_keysym(display, keyc, 0);
       name = XKeysymToString(keys);
       wine_tsx11_unlock();
+
+      if (name && (vkey == VK_SHIFT || vkey == VK_CONTROL || vkey == VK_MENU))
+      {
+          char* idx = strrchr(name, '_');
+          if (idx && (strcasecmp(idx, "_r") == 0 || strcasecmp(idx, "_l") == 0))
+          {
+              INT rc = 0;
+              TRACE("found scan=%04x keyc=%u keysym=%lx modified_string=%s\n",
+                    scanCode, keyc, keys, debugstr_an(name,idx-name));
+              if (lpBuffer && nSize)
+              {
+                  rc = MultiByteToWideChar(CP_UNIXCP, 0, name, idx-name+1, lpBuffer, nSize);
+                  if (rc > 0) lpBuffer[rc - 1] = 0;
+              }
+              return rc;
+          }
+      }
+
       TRACE("found scan=%04x keyc=%u keysym=%04x string=%s\n",
             scanCode, keyc, (int)keys, debugstr_a(name));
       if (lpBuffer && nSize && name)




More information about the wine-cvs mailing list