user32/tests: Fix OemKeyScan failures with input method editors.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
41a76447dd
commit
72ab2d5b07
|
@ -1,5 +1,5 @@
|
||||||
TESTDLL = user32.dll
|
TESTDLL = user32.dll
|
||||||
IMPORTS = user32 gdi32 advapi32
|
IMPORTS = user32 gdi32 advapi32 imm32
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
broadcast.c \
|
broadcast.c \
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "winnls.h"
|
#include "winnls.h"
|
||||||
|
#include "imm.h"
|
||||||
|
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
@ -2515,6 +2516,7 @@ static void test_OemKeyScan(void)
|
||||||
DWORD ret, expect, vkey, scan;
|
DWORD ret, expect, vkey, scan;
|
||||||
WCHAR oem, wchr;
|
WCHAR oem, wchr;
|
||||||
char oem_char;
|
char oem_char;
|
||||||
|
BOOL ime = ImmIsIME(GetKeyboardLayout(0));
|
||||||
|
|
||||||
for (oem = 0; oem < 0x200; oem++)
|
for (oem = 0; oem < 0x200; oem++)
|
||||||
{
|
{
|
||||||
|
@ -2527,7 +2529,10 @@ static void test_OemKeyScan(void)
|
||||||
{
|
{
|
||||||
vkey = VkKeyScanW( wchr );
|
vkey = VkKeyScanW( wchr );
|
||||||
scan = MapVirtualKeyW( LOBYTE( vkey ), MAPVK_VK_TO_VSC );
|
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;
|
expect = -1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue