Alex Henrie : user32/tests: Fix OemKeyScan failures with input method editors.

Alexandre Julliard julliard at winehq.org
Thu Dec 28 15:18:28 CST 2017


Module: wine
Branch: master
Commit: 72ab2d5b078d0ebad70a0baed29a80ce6b6c86ad
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=72ab2d5b078d0ebad70a0baed29a80ce6b6c86ad

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Thu Dec 28 10:45:46 2017 -0700

user32/tests: Fix OemKeyScan failures with input method editors.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/Makefile.in | 2 +-
 dlls/user32/tests/input.c     | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in
index 7149dc8..c71cbe2 100644
--- a/dlls/user32/tests/Makefile.in
+++ b/dlls/user32/tests/Makefile.in
@@ -1,5 +1,5 @@
 TESTDLL   = user32.dll
-IMPORTS   = user32 gdi32 advapi32
+IMPORTS   = user32 gdi32 advapi32 imm32
 
 C_SRCS = \
 	broadcast.c \
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 793590e..a15a644 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -54,6 +54,7 @@
 #include "winbase.h"
 #include "winuser.h"
 #include "winnls.h"
+#include "imm.h"
 
 #include "wine/test.h"
 
@@ -2515,6 +2516,7 @@ static void test_OemKeyScan(void)
     DWORD ret, expect, vkey, scan;
     WCHAR oem, wchr;
     char oem_char;
+    BOOL ime = ImmIsIME(GetKeyboardLayout(0));
 
     for (oem = 0; oem < 0x200; oem++)
     {
@@ -2527,7 +2529,10 @@ static void test_OemKeyScan(void)
         {
             vkey = VkKeyScanW( wchr );
             scan = MapVirtualKeyW( LOBYTE( vkey ), MAPVK_VK_TO_VSC );
-            if (!scan)
+            /* OemKeyScan returns -1 for any character that has to go through
+             * the IME, whereas VkKeyScan returns the virtual key code for the
+             * question mark key */
+            if (!scan || (ime && wchr != '?' && vkey == VkKeyScanW( '?' )))
                 expect = -1;
             else
             {




More information about the wine-cvs mailing list