Commit 92cbeed9 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

user32: Add a default GetKeyboardLayout implementation.

parent f044f401
......@@ -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 )
......
......@@ -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();
}
/****************************************************************************
......
......@@ -879,26 +879,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
*/
SHORT CDECL ANDROID_VkKeyScanEx( WCHAR ch, HKL hkl )
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment