Module: wine Branch: master Commit: 0b19f8b2ffc60f9156d1df801d9fdae9688e0fb4 URL: https://gitlab.winehq.org/wine/wine/-/commit/0b19f8b2ffc60f9156d1df801d9fdae...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Thu Jan 18 19:55:19 2024 +0800
user32/tests: Test keyboard layout in CJK locales.
Also tested manually on Windows 10 with Korean, Chinese, and Japanese IME activated.
---
dlls/user32/tests/input.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index d48440a20be..5bc1003f644 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -5236,6 +5236,33 @@ static void test_input_desktop( char **argv ) ok_ret( 1, SetCursorPos( pos.x, pos.y ) ); }
+static void test_keyboard_layout(void) +{ + const CHAR *layout_name; + LANGID lang_id; + HKL hkl; + + /* Test that the high word of the keyboard layout in CJK locale is the same as the low word, + * even when IME is on */ + lang_id = PRIMARYLANGID(GetUserDefaultLCID()); + if (lang_id == LANG_CHINESE || lang_id == LANG_JAPANESE || lang_id == LANG_KOREAN) + { + hkl = GetKeyboardLayout(0); + todo_wine + ok(HIWORD(hkl) == LOWORD(hkl), "Got unexpected hkl %p.\n", hkl); + + if (lang_id == LANG_CHINESE) + layout_name = "00000804"; + else if (lang_id == LANG_JAPANESE) + layout_name = "00000411"; + else if (lang_id == LANG_KOREAN) + layout_name = "00000412"; + hkl = LoadKeyboardLayoutA(layout_name, 0); + todo_wine + ok(HIWORD(hkl) == LOWORD(hkl), "Got unexpected hkl %p.\n", hkl); + } +} + START_TEST(input) { char **argv; @@ -5269,6 +5296,7 @@ START_TEST(input) test_ToUnicode(); test_ToAscii(); test_get_async_key_state(); + test_keyboard_layout(); test_keyboard_layout_name(); test_ActivateKeyboardLayout( argv ); test_key_names();