user32: Add a default GetKeyboardLayout implementation.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-05-03 11:37:58 +02:00 committed by Alexandre Julliard
parent f044f401f7
commit 92cbeed9d7
4 changed files with 6 additions and 23 deletions

View File

@ -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 )

View File

@ -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();
}
/****************************************************************************

View File

@ -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
*/

View File

@ -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