Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/driver.c | 2 +- dlls/user32/input.c | 6 +++++- dlls/wineandroid.drv/keyboard.c | 20 -------------------- dlls/wineandroid.drv/wineandroid.drv.spec | 1 - 4 files changed, 6 insertions(+), 23 deletions(-)
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index f683cf25b7e..efaa04db096 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -208,7 +208,7 @@ static INT CDECL nulldrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
static HKL CDECL nulldrv_GetKeyboardLayout( DWORD thread_id ) { - return 0; + return (HKL)~0; /* use default implementation */ }
static BOOL CDECL nulldrv_GetKeyboardLayoutName( LPWSTR name ) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index d3dcf375746..1f795e43545 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -1083,7 +1083,11 @@ UINT WINAPI GetKBCodePage(void) */ HKL WINAPI GetKeyboardLayout(DWORD thread_id) { - return USER_Driver->pGetKeyboardLayout(thread_id); + HKL layout; + + if ((layout = USER_Driver->pGetKeyboardLayout( thread_id )) != (HKL)~0) return layout; + + return get_locale_kbd_layout(); }
/**************************************************************************** diff --git a/dlls/wineandroid.drv/keyboard.c b/dlls/wineandroid.drv/keyboard.c index 04565c3fad8..803f13d8f39 100644 --- a/dlls/wineandroid.drv/keyboard.c +++ b/dlls/wineandroid.drv/keyboard.c @@ -878,26 +878,6 @@ UINT CDECL ANDROID_MapVirtualKeyEx( UINT code, UINT maptype, HKL hkl ) }
-/*********************************************************************** - * ANDROID_GetKeyboardLayout - */ -HKL CDECL ANDROID_GetKeyboardLayout( DWORD thread_id ) -{ - ULONG_PTR layout = GetUserDefaultLCID(); - LANGID langid; - static int once; - - langid = PRIMARYLANGID(LANGIDFROMLCID( layout )); - if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN) - layout = MAKELONG( layout, 0xe001 ); /* IME */ - else - layout |= layout << 16; - - if (!once++) FIXME( "returning %lx\n", layout ); - return (HKL)layout; -} - - /*********************************************************************** * ANDROID_VkKeyScanEx */ diff --git a/dlls/wineandroid.drv/wineandroid.drv.spec b/dlls/wineandroid.drv/wineandroid.drv.spec index 6f27c1586b3..d79665ecc72 100644 --- a/dlls/wineandroid.drv/wineandroid.drv.spec +++ b/dlls/wineandroid.drv/wineandroid.drv.spec @@ -5,7 +5,6 @@ # USER driver
@ cdecl GetKeyNameText(long ptr long) ANDROID_GetKeyNameText -@ cdecl GetKeyboardLayout(long) ANDROID_GetKeyboardLayout @ cdecl MapVirtualKeyEx(long long long) ANDROID_MapVirtualKeyEx @ cdecl VkKeyScanEx(long long) ANDROID_VkKeyScanEx @ cdecl SetCursor(long) ANDROID_SetCursor