[2/2] winex11.drv: Fix CTRL + Tab and CTRL + SHIFT + Return handling (try 2)

Andre Wisplinghoff andre.wisplinghoff at gmail.com
Thu Jul 31 08:12:06 CDT 2008


Changelog:
    winex11.drv: Fixed CTRL + Tab and CTRL + SHIFT + Return handling

---
 dlls/user32/tests/input.c   |    4 ++--
 dlls/winex11.drv/keyboard.c |   17 +++++++++++++----
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 7c58992..87075e7 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -1189,7 +1189,7 @@ void test_ToUnicode()
     state[VK_LCONTROL] |= 0x80;
 
     ret = ToUnicode(VK_TAB, 0x0f, state, wStr, 2, 0);
-    todo_wine ok(ret == 0, "ToUnicode for CTRL + Tab didn't return 0 
(was %i)\n", ret);
+    ok(ret == 0, "ToUnicode for CTRL + Tab didn't return 0 (was %i)\n", 
ret);
 
     ret = ToUnicode(VK_RETURN, 0x1c, state, wStr, 2, 0);
     ok(ret == 1, "ToUnicode for CTRL + Return didn't return 1 (was 
%i)", ret);
@@ -1199,7 +1199,7 @@ void test_ToUnicode()
     state[VK_SHIFT] |= 0x80;
     state[VK_LSHIFT] |= 0x80;
     ret = ToUnicode(VK_RETURN, 0x1c, state, wStr, 2, 0);
-    todo_wine ok(ret == 0, "ToUnicode for CTRL + SHIFT + Return didn't 
return 0 (was %i)\n", ret);
+    ok(ret == 0, "ToUnicode for CTRL + SHIFT + Return didn't return 0 
(was %i)\n", ret);
 }
 
 START_TEST(input)
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index bf399c9..738de57 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -2614,11 +2614,12 @@ INT X11DRV_ToUnicodeEx(UINT virtKey, UINT 
scanCode, LPBYTE lpKeyState,
         }
 
         /* more areas where X returns characters but Windows does not
-           CTRL + number or CTRL + symbol */
+           CTRL + number, CTRL + symbol and CTRL + tab */
         if (e.state & ControlMask)
         {
             if (((keysym>=33) && (keysym < 'A')) ||
-                ((keysym > 'Z') && (keysym < 'a')))
+                ((keysym > 'Z') && (keysym < 'a')) ||
+                (keysym == XK_Tab))
             {
                 lpChar[0] = 0;
                 ret = 0;
@@ -2641,8 +2642,16 @@ INT X11DRV_ToUnicodeEx(UINT virtKey, UINT 
scanCode, LPBYTE lpKeyState,
     else if((lpKeyState[VK_CONTROL] & 0x80) /* Control is pressed */
         && (keysym == XK_Return || keysym == XK_KP_Enter))
         {
-            lpChar[0] = '\n';
-            ret = 1;
+            if(lpKeyState[VK_SHIFT] & 0x80) /* Shift is pressed */
+            {
+                lpChar[0] = 0;
+                ret = 0;
+            }
+            else
+            {
+                lpChar[0] = '\n';
+                ret = 1;
+            }
         }
 
         /* Hack to detect an XLookupString hard-coded to Latin1 */
-- 
1.5.6.4



More information about the wine-patches mailing list