Commit b0c2e54a authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Add preliminary support for keyboard layout APIs.

parent 2d00b08a
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
# USER driver # USER driver
@ cdecl VkKeyScan(long) TTYDRV_VkKeyScan @ cdecl VkKeyScanEx(long long) TTYDRV_VkKeyScanEx
@ cdecl MapVirtualKey(long long) TTYDRV_MapVirtualKey @ cdecl MapVirtualKeyEx(long long long) TTYDRV_MapVirtualKeyEx
@ cdecl GetKeyNameText(long str long) TTYDRV_GetKeyNameText @ cdecl GetKeyNameText(long ptr long) TTYDRV_GetKeyNameText
@ cdecl ToUnicode(long long ptr ptr long long) TTYDRV_ToUnicode @ cdecl ToUnicodeEx(long long ptr ptr long long long) TTYDRV_ToUnicodeEx
@ cdecl Beep() TTYDRV_Beep @ cdecl Beep() TTYDRV_Beep
@ cdecl SetCursor(ptr) TTYDRV_SetCursor @ cdecl SetCursor(ptr) TTYDRV_SetCursor
@ cdecl GetScreenSaveActive() TTYDRV_GetScreenSaveActive @ cdecl GetScreenSaveActive() TTYDRV_GetScreenSaveActive
......
...@@ -34,17 +34,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv); ...@@ -34,17 +34,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
struct tagCURSORICONINFO; struct tagCURSORICONINFO;
/*********************************************************************** /***********************************************************************
* VkKeyScan (TTYDRV.@) * VkKeyScanEx (TTYDRV.@)
*/ */
WORD TTYDRV_VkKeyScan(CHAR cChar) SHORT TTYDRV_VkKeyScanEx(WCHAR cChar, HKL hkl)
{ {
return 0; return 0;
} }
/*********************************************************************** /***********************************************************************
* MapVirtualKey (TTYDRV.@) * MapVirtualKeyEx (TTYDRV.@)
*/ */
UINT16 TTYDRV_MapVirtualKey(UINT16 wCode, UINT16 wMapType) UINT TTYDRV_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl)
{ {
return 0; return 0;
} }
...@@ -52,7 +52,7 @@ UINT16 TTYDRV_MapVirtualKey(UINT16 wCode, UINT16 wMapType) ...@@ -52,7 +52,7 @@ UINT16 TTYDRV_MapVirtualKey(UINT16 wCode, UINT16 wMapType)
/*********************************************************************** /***********************************************************************
* GetKeyNameText (TTYDRV.@) * GetKeyNameText (TTYDRV.@)
*/ */
INT16 TTYDRV_GetKeyNameText( LONG lParam, LPSTR lpBuffer, INT16 nSize ) INT TTYDRV_GetKeyNameText( LONG lParam, LPWSTR lpBuffer, INT nSize )
{ {
if(lpBuffer && nSize) if(lpBuffer && nSize)
{ {
...@@ -62,10 +62,10 @@ INT16 TTYDRV_GetKeyNameText( LONG lParam, LPSTR lpBuffer, INT16 nSize ) ...@@ -62,10 +62,10 @@ INT16 TTYDRV_GetKeyNameText( LONG lParam, LPSTR lpBuffer, INT16 nSize )
} }
/*********************************************************************** /***********************************************************************
* ToUnicode (TTYDRV.@) * ToUnicodeEx (TTYDRV.@)
*/ */
INT TTYDRV_ToUnicode( UINT virtKey, UINT scanCode, LPBYTE lpKeyState, INT TTYDRV_ToUnicodeEx( UINT virtKey, UINT scanCode, LPBYTE lpKeyState,
LPWSTR pwszBuff, int cchBuff, UINT flags ) LPWSTR pwszBuff, int cchBuff, UINT flags, HKL hkl )
{ {
return 0; return 0;
} }
......
...@@ -591,7 +591,7 @@ ...@@ -591,7 +591,7 @@
@ stdcall UnhookWindowsHook(long ptr) @ stdcall UnhookWindowsHook(long ptr)
@ stdcall UnhookWindowsHookEx(long) @ stdcall UnhookWindowsHookEx(long)
@ stdcall UnionRect(ptr ptr ptr) @ stdcall UnionRect(ptr ptr ptr)
@ stub UnloadKeyboardLayout @ stdcall UnloadKeyboardLayout(long)
@ stub UnlockWindowStation @ stub UnlockWindowStation
@ stdcall UnpackDDElParam(long long ptr ptr) @ stdcall UnpackDDElParam(long long ptr ptr)
@ stdcall UnregisterClassA(str long) @ stdcall UnregisterClassA(str long)
......
...@@ -76,10 +76,16 @@ static BOOL load_driver(void) ...@@ -76,10 +76,16 @@ static BOOL load_driver(void)
} }
GET_USER_FUNC(InitKeyboard); GET_USER_FUNC(InitKeyboard);
GET_USER_FUNC(VkKeyScan); GET_USER_FUNC(VkKeyScanEx);
GET_USER_FUNC(MapVirtualKey); GET_USER_FUNC(MapVirtualKeyEx);
GET_USER_FUNC(GetKeyNameText); GET_USER_FUNC(GetKeyNameText);
GET_USER_FUNC(ToUnicode); GET_USER_FUNC(ToUnicodeEx);
GET_USER_FUNC(GetKeyboardLayoutList);
GET_USER_FUNC(GetKeyboardLayout);
GET_USER_FUNC(GetKeyboardLayoutName);
GET_USER_FUNC(LoadKeyboardLayout);
GET_USER_FUNC(ActivateKeyboardLayout);
GET_USER_FUNC(UnloadKeyboardLayout);
GET_USER_FUNC(Beep); GET_USER_FUNC(Beep);
GET_USER_FUNC(InitMouse); GET_USER_FUNC(InitMouse);
GET_USER_FUNC(SetCursor); GET_USER_FUNC(SetCursor);
......
...@@ -6,7 +6,7 @@ VPATH = @srcdir@ ...@@ -6,7 +6,7 @@ VPATH = @srcdir@
MODULE = x11drv.dll MODULE = x11drv.dll
IMPORTS = user32 gdi32 advapi32 kernel32 ntdll IMPORTS = user32 gdi32 advapi32 kernel32 ntdll
EXTRAINCL = @X_CFLAGS@ EXTRAINCL = @X_CFLAGS@
EXTRALIBS = @X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@ EXTRALIBS = $(LIBUNICODE) @X_LIBS@ @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
C_SRCS = \ C_SRCS = \
$(TOPOBJDIR)/graphics/x11drv/bitblt.c \ $(TOPOBJDIR)/graphics/x11drv/bitblt.c \
......
...@@ -63,10 +63,16 @@ ...@@ -63,10 +63,16 @@
# USER driver # USER driver
@ cdecl InitKeyboard(ptr) X11DRV_InitKeyboard @ cdecl InitKeyboard(ptr) X11DRV_InitKeyboard
@ cdecl VkKeyScan(long) X11DRV_VkKeyScan @ cdecl VkKeyScanEx(long long) X11DRV_VkKeyScanEx
@ cdecl MapVirtualKey(long long) X11DRV_MapVirtualKey @ cdecl MapVirtualKeyEx(long long long) X11DRV_MapVirtualKeyEx
@ cdecl GetKeyNameText(long str long) X11DRV_GetKeyNameText @ cdecl GetKeyNameText(long ptr long) X11DRV_GetKeyNameText
@ cdecl ToUnicode(long long ptr ptr long long) X11DRV_ToUnicode @ cdecl ToUnicodeEx(long long ptr ptr long long long) X11DRV_ToUnicodeEx
@ cdecl GetKeyboardLayoutList(long ptr) X11DRV_GetKeyboardLayoutList
@ cdecl GetKeyboardLayout(long) X11DRV_GetKeyboardLayout
@ cdecl GetKeyboardLayoutName(ptr) X11DRV_GetKeyboardLayoutName
@ cdecl LoadKeyboardLayout(wstr long) X11DRV_LoadKeyboardLayout
@ cdecl ActivateKeyboardLayout(long long) X11DRV_ActivateKeyboardLayout
@ cdecl UnloadKeyboardLayout(long) X11DRV_UnloadKeyboardLayout
@ cdecl Beep() X11DRV_Beep @ cdecl Beep() X11DRV_Beep
@ cdecl InitMouse(ptr) X11DRV_InitMouse @ cdecl InitMouse(ptr) X11DRV_InitMouse
@ cdecl SetCursor(ptr) X11DRV_SetCursor @ cdecl SetCursor(ptr) X11DRV_SetCursor
......
...@@ -72,10 +72,16 @@ enum wine_internal_message ...@@ -72,10 +72,16 @@ enum wine_internal_message
typedef struct tagUSER_DRIVER { typedef struct tagUSER_DRIVER {
/* keyboard functions */ /* keyboard functions */
void (*pInitKeyboard)(LPBYTE); void (*pInitKeyboard)(LPBYTE);
WORD (*pVkKeyScan)(CHAR); SHORT (*pVkKeyScanEx)(WCHAR, HKL);
UINT (*pMapVirtualKey)(UINT,UINT); UINT (*pMapVirtualKeyEx)(UINT, UINT, HKL);
INT (*pGetKeyNameText)(LONG,LPSTR,INT); INT (*pGetKeyNameText)(LONG, LPWSTR, INT);
INT (*pToUnicode)(UINT, UINT, LPBYTE, LPWSTR, int, UINT); INT (*pToUnicodeEx)(UINT, UINT, LPBYTE, LPWSTR, int, UINT, HKL);
UINT (*pGetKeyboardLayoutList)(INT, HKL *);
HKL (*pGetKeyboardLayout)(DWORD);
BOOL (*pGetKeyboardLayoutName)(LPWSTR);
HKL (*pLoadKeyboardLayout)(LPCWSTR, UINT);
HKL (*pActivateKeyboardLayout)(HKL, UINT);
BOOL (*pUnloadKeyboardLayout)(HKL);
void (*pBeep)(void); void (*pBeep)(void);
/* mouse functions */ /* mouse functions */
void (*pInitMouse)(LPBYTE); void (*pInitMouse)(LPBYTE);
......
...@@ -3714,7 +3714,7 @@ BOOL WINAPI EnumThreadWindows(DWORD,WNDENUMPROC,LPARAM); ...@@ -3714,7 +3714,7 @@ BOOL WINAPI EnumThreadWindows(DWORD,WNDENUMPROC,LPARAM);
BOOL WINAPI ExitWindowsEx(UINT,DWORD); BOOL WINAPI ExitWindowsEx(UINT,DWORD);
BOOL WINAPI GetIconInfo(HICON,PICONINFO); BOOL WINAPI GetIconInfo(HICON,PICONINFO);
HKL WINAPI GetKeyboardLayout(DWORD); HKL WINAPI GetKeyboardLayout(DWORD);
INT WINAPI GetKeyboardLayoutList(INT,HKL *); UINT WINAPI GetKeyboardLayoutList(INT,HKL *);
BOOL WINAPI GetComboBoxInfo(HWND,PCOMBOBOXINFO); BOOL WINAPI GetComboBoxInfo(HWND,PCOMBOBOXINFO);
DWORD WINAPI GetMenuContextHelpId(HMENU); DWORD WINAPI GetMenuContextHelpId(HMENU);
UINT WINAPI GetMenuDefaultItem(HMENU,UINT,UINT); UINT WINAPI GetMenuDefaultItem(HMENU,UINT,UINT);
...@@ -3767,9 +3767,11 @@ HWINEVENTHOOK WINAPI SetWinEventHook(DWORD,DWORD,HMODULE,WINEVENTPROC,DWORD,DWOR ...@@ -3767,9 +3767,11 @@ HWINEVENTHOOK WINAPI SetWinEventHook(DWORD,DWORD,HMODULE,WINEVENTPROC,DWORD,DWOR
WORD WINAPI TileWindows (HWND, UINT, const LPRECT, WORD WINAPI TileWindows (HWND, UINT, const LPRECT,
UINT, const HWND *); UINT, const HWND *);
INT WINAPI ToUnicode(UINT,UINT,PBYTE,LPWSTR,int,UINT); INT WINAPI ToUnicode(UINT,UINT,PBYTE,LPWSTR,int,UINT);
INT WINAPI ToUnicodeEx(UINT,UINT,LPBYTE,LPWSTR,int,UINT,HKL);
BOOL WINAPI TrackPopupMenuEx(HMENU,UINT,INT,INT,HWND, BOOL WINAPI TrackPopupMenuEx(HMENU,UINT,INT,INT,HWND,
LPTPMPARAMS); LPTPMPARAMS);
BOOL WINAPI UnhookWinEvent(HWINEVENTHOOK); BOOL WINAPI UnhookWinEvent(HWINEVENTHOOK);
BOOL WINAPI UnloadKeyboardLayout(HKL);
BOOL WINAPI UnregisterDeviceNotification(HDEVNOTIFY); BOOL WINAPI UnregisterDeviceNotification(HDEVNOTIFY);
BOOL WINAPI UnregisterHotKey(HWND,INT); BOOL WINAPI UnregisterHotKey(HWND,INT);
DWORD WINAPI WaitForInputIdle(HANDLE,DWORD); DWORD WINAPI WaitForInputIdle(HANDLE,DWORD);
...@@ -4077,8 +4079,8 @@ INT WINAPI GetKeyboardType(INT); ...@@ -4077,8 +4079,8 @@ INT WINAPI GetKeyboardType(INT);
INT WINAPI GetKeyNameTextA(LONG,LPSTR,INT); INT WINAPI GetKeyNameTextA(LONG,LPSTR,INT);
INT WINAPI GetKeyNameTextW(LONG,LPWSTR,INT); INT WINAPI GetKeyNameTextW(LONG,LPWSTR,INT);
#define GetKeyNameText WINELIB_NAME_AW(GetKeyNameText) #define GetKeyNameText WINELIB_NAME_AW(GetKeyNameText)
INT WINAPI GetKeyboardLayoutNameA(LPSTR); BOOL WINAPI GetKeyboardLayoutNameA(LPSTR);
INT WINAPI GetKeyboardLayoutNameW(LPWSTR); BOOL WINAPI GetKeyboardLayoutNameW(LPWSTR);
#define GetKeyboardLayoutName WINELIB_NAME_AW(GetKeyboardLayoutName) #define GetKeyboardLayoutName WINELIB_NAME_AW(GetKeyboardLayoutName)
SHORT WINAPI GetKeyState(INT); SHORT WINAPI GetKeyState(INT);
HWND WINAPI GetLastActivePopup(HWND); HWND WINAPI GetLastActivePopup(HWND);
...@@ -4399,8 +4401,8 @@ BOOL WINAPI UpdateWindow(HWND); ...@@ -4399,8 +4401,8 @@ BOOL WINAPI UpdateWindow(HWND);
UINT WINAPI UserRealizePalette(HDC); UINT WINAPI UserRealizePalette(HDC);
BOOL WINAPI ValidateRect(HWND,const RECT*); BOOL WINAPI ValidateRect(HWND,const RECT*);
BOOL WINAPI ValidateRgn(HWND,HRGN); BOOL WINAPI ValidateRgn(HWND,HRGN);
WORD WINAPI VkKeyScanA(CHAR); SHORT WINAPI VkKeyScanA(CHAR);
WORD WINAPI VkKeyScanW(WCHAR); SHORT WINAPI VkKeyScanW(WCHAR);
#define VkKeyScan WINELIB_NAME_AW(VkKeyScan) #define VkKeyScan WINELIB_NAME_AW(VkKeyScan)
WORD WINAPI VkKeyScanExA(CHAR, HKL); WORD WINAPI VkKeyScanExA(CHAR, HKL);
WORD WINAPI VkKeyScanExW(WCHAR, HKL); WORD WINAPI VkKeyScanExW(WCHAR, HKL);
......
...@@ -859,6 +859,14 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ...@@ -859,6 +859,14 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
} }
break; break;
case WM_INPUTLANGCHANGEREQUEST:
/* notify about the switch only if it's really our current layout */
if ((HKL)lParam == GetKeyboardLayout(0))
result = SendMessageA( hwnd, WM_INPUTLANGCHANGE, wParam, lParam );
else
result = 0;
break;
default: default:
result = DEFWND_DefWinProc( hwnd, msg, wParam, lParam ); result = DEFWND_DefWinProc( hwnd, msg, wParam, lParam );
break; break;
...@@ -970,6 +978,14 @@ LRESULT WINAPI DefWindowProcW( ...@@ -970,6 +978,14 @@ LRESULT WINAPI DefWindowProcW(
} }
break; break;
case WM_INPUTLANGCHANGEREQUEST:
/* notify about the switch only if it's really our current layout */
if ((HKL)lParam == GetKeyboardLayout(0))
result = SendMessageW( hwnd, WM_INPUTLANGCHANGE, wParam, lParam );
else
result = 0;
break;
default: default:
result = DEFWND_DefWinProc( hwnd, msg, wParam, lParam ); result = DEFWND_DefWinProc( hwnd, msg, wParam, lParam );
break; break;
......
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