Commit aef19abc authored by Alexandre Julliard's avatar Alexandre Julliard

Moved SendInput and related functions to the USER driver to avoid a

number of dll separation hacks.
parent 6bd194d2
...@@ -83,19 +83,19 @@ static BOOL load_driver(void) ...@@ -83,19 +83,19 @@ static BOOL load_driver(void)
ExitProcess(1); ExitProcess(1);
} }
GET_USER_FUNC(InitKeyboard); GET_USER_FUNC(ActivateKeyboardLayout);
GET_USER_FUNC(VkKeyScanEx); GET_USER_FUNC(Beep);
GET_USER_FUNC(MapVirtualKeyEx); GET_USER_FUNC(GetAsyncKeyState);
GET_USER_FUNC(GetKeyNameText); GET_USER_FUNC(GetKeyNameText);
GET_USER_FUNC(ToUnicodeEx);
GET_USER_FUNC(GetKeyboardLayoutList);
GET_USER_FUNC(GetKeyboardLayout); GET_USER_FUNC(GetKeyboardLayout);
GET_USER_FUNC(GetKeyboardLayoutList);
GET_USER_FUNC(GetKeyboardLayoutName); GET_USER_FUNC(GetKeyboardLayoutName);
GET_USER_FUNC(LoadKeyboardLayout); GET_USER_FUNC(LoadKeyboardLayout);
GET_USER_FUNC(ActivateKeyboardLayout); GET_USER_FUNC(MapVirtualKeyEx);
GET_USER_FUNC(SendInput);
GET_USER_FUNC(ToUnicodeEx);
GET_USER_FUNC(UnloadKeyboardLayout); GET_USER_FUNC(UnloadKeyboardLayout);
GET_USER_FUNC(Beep); GET_USER_FUNC(VkKeyScanEx);
GET_USER_FUNC(InitMouse);
GET_USER_FUNC(SetCursor); GET_USER_FUNC(SetCursor);
GET_USER_FUNC(GetCursorPos); GET_USER_FUNC(GetCursorPos);
GET_USER_FUNC(SetCursorPos); GET_USER_FUNC(SetCursorPos);
...@@ -244,12 +244,6 @@ static BOOL process_attach(void) ...@@ -244,12 +244,6 @@ static BOOL process_attach(void)
/* Create desktop window */ /* Create desktop window */
if (!WIN_CreateDesktopWindow()) return FALSE; if (!WIN_CreateDesktopWindow()) return FALSE;
/* Initialize keyboard driver */
if (USER_Driver.pInitKeyboard) USER_Driver.pInitKeyboard( InputKeyStateTable );
/* Initialize mouse driver */
if (USER_Driver.pInitMouse) USER_Driver.pInitMouse( InputKeyStateTable );
return TRUE; return TRUE;
} }
......
...@@ -62,23 +62,23 @@ struct tagCURSORICONINFO; ...@@ -62,23 +62,23 @@ struct tagCURSORICONINFO;
typedef struct tagUSER_DRIVER { typedef struct tagUSER_DRIVER {
/* keyboard functions */ /* keyboard functions */
void (*pInitKeyboard)(LPBYTE); HKL (*pActivateKeyboardLayout)(HKL, UINT);
SHORT (*pVkKeyScanEx)(WCHAR, HKL); void (*pBeep)(void);
UINT (*pMapVirtualKeyEx)(UINT, UINT, HKL); SHORT (*pGetAsyncKeyState)(INT);
INT (*pGetKeyNameText)(LONG, LPWSTR, INT); INT (*pGetKeyNameText)(LONG, LPWSTR, INT);
INT (*pToUnicodeEx)(UINT, UINT, LPBYTE, LPWSTR, int, UINT, HKL);
UINT (*pGetKeyboardLayoutList)(INT, HKL *);
HKL (*pGetKeyboardLayout)(DWORD); HKL (*pGetKeyboardLayout)(DWORD);
UINT (*pGetKeyboardLayoutList)(INT, HKL *);
BOOL (*pGetKeyboardLayoutName)(LPWSTR); BOOL (*pGetKeyboardLayoutName)(LPWSTR);
HKL (*pLoadKeyboardLayout)(LPCWSTR, UINT); HKL (*pLoadKeyboardLayout)(LPCWSTR, UINT);
HKL (*pActivateKeyboardLayout)(HKL, UINT); UINT (*pMapVirtualKeyEx)(UINT, UINT, HKL);
UINT (*pSendInput)(UINT, LPINPUT, int);
INT (*pToUnicodeEx)(UINT, UINT, LPBYTE, LPWSTR, int, UINT, HKL);
BOOL (*pUnloadKeyboardLayout)(HKL); BOOL (*pUnloadKeyboardLayout)(HKL);
void (*pBeep)(void); SHORT (*pVkKeyScanEx)(WCHAR, HKL);
/* mouse functions */ /* mouse functions */
void (*pInitMouse)(LPBYTE);
void (*pSetCursor)(struct tagCURSORICONINFO *); void (*pSetCursor)(struct tagCURSORICONINFO *);
void (*pGetCursorPos)(LPPOINT); BOOL (*pGetCursorPos)(LPPOINT);
void (*pSetCursorPos)(INT,INT); BOOL (*pSetCursorPos)(INT,INT);
/* screen saver functions */ /* screen saver functions */
BOOL (*pGetScreenSaveActive)(void); BOOL (*pGetScreenSaveActive)(void);
void (*pSetScreenSaveActive)(BOOL); void (*pSetScreenSaveActive)(BOOL);
...@@ -119,8 +119,6 @@ typedef struct tagUSER_DRIVER { ...@@ -119,8 +119,6 @@ typedef struct tagUSER_DRIVER {
extern USER_DRIVER USER_Driver; extern USER_DRIVER USER_Driver;
extern HMODULE user32_module; extern HMODULE user32_module;
extern BYTE InputKeyStateTable[256];
extern BYTE AsyncKeyStateTable[256];
extern DWORD USER16_AlertableWait; extern DWORD USER16_AlertableWait;
extern BOOL CLIPBOARD_ReleaseOwner(void); extern BOOL CLIPBOARD_ReleaseOwner(void);
......
...@@ -951,3 +951,32 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) ...@@ -951,3 +951,32 @@ LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp )
return 0; return 0;
} }
} }
/***********************************************************************
* X11DRV_SendInput (X11DRV.@)
*/
UINT X11DRV_SendInput( UINT count, LPINPUT inputs, int size )
{
UINT i;
for (i = 0; i < count; i++, inputs++)
{
switch(inputs->type)
{
case INPUT_MOUSE:
X11DRV_send_mouse_input( 0, inputs->u.mi.dwFlags, inputs->u.mi.dx, inputs->u.mi.dy,
inputs->u.mi.mouseData, inputs->u.mi.time,
inputs->u.mi.dwExtraInfo, LLMHF_INJECTED );
break;
case INPUT_KEYBOARD:
X11DRV_send_keyboard_input( inputs->u.ki.wVk, inputs->u.ki.wScan, inputs->u.ki.dwFlags,
inputs->u.ki.time, inputs->u.ki.dwExtraInfo, LLKHF_INJECTED );
break;
case INPUT_HARDWARE:
FIXME( "INPUT_HARDWARE not supported\n" );
break;
}
}
return count;
}
...@@ -63,19 +63,19 @@ ...@@ -63,19 +63,19 @@
# USER driver # USER driver
@ cdecl InitKeyboard(ptr) X11DRV_InitKeyboard @ cdecl ActivateKeyboardLayout(long long) X11DRV_ActivateKeyboardLayout
@ cdecl VkKeyScanEx(long long) X11DRV_VkKeyScanEx @ cdecl Beep() X11DRV_Beep
@ cdecl MapVirtualKeyEx(long long long) X11DRV_MapVirtualKeyEx @ cdecl GetAsyncKeyState(long) X11DRV_GetAsyncKeyState
@ cdecl GetKeyNameText(long ptr long) X11DRV_GetKeyNameText @ cdecl GetKeyNameText(long ptr long) X11DRV_GetKeyNameText
@ cdecl ToUnicodeEx(long long ptr ptr long long long) X11DRV_ToUnicodeEx
@ cdecl GetKeyboardLayoutList(long ptr) X11DRV_GetKeyboardLayoutList
@ cdecl GetKeyboardLayout(long) X11DRV_GetKeyboardLayout @ cdecl GetKeyboardLayout(long) X11DRV_GetKeyboardLayout
@ cdecl GetKeyboardLayoutList(long ptr) X11DRV_GetKeyboardLayoutList
@ cdecl GetKeyboardLayoutName(ptr) X11DRV_GetKeyboardLayoutName @ cdecl GetKeyboardLayoutName(ptr) X11DRV_GetKeyboardLayoutName
@ cdecl LoadKeyboardLayout(wstr long) X11DRV_LoadKeyboardLayout @ cdecl LoadKeyboardLayout(wstr long) X11DRV_LoadKeyboardLayout
@ cdecl ActivateKeyboardLayout(long long) X11DRV_ActivateKeyboardLayout @ cdecl MapVirtualKeyEx(long long long) X11DRV_MapVirtualKeyEx
@ cdecl SendInput(long ptr long) X11DRV_SendInput
@ cdecl ToUnicodeEx(long long ptr ptr long long long) X11DRV_ToUnicodeEx
@ cdecl UnloadKeyboardLayout(long) X11DRV_UnloadKeyboardLayout @ cdecl UnloadKeyboardLayout(long) X11DRV_UnloadKeyboardLayout
@ cdecl Beep() X11DRV_Beep @ cdecl VkKeyScanEx(long long) X11DRV_VkKeyScanEx
@ cdecl InitMouse(ptr) X11DRV_InitMouse
@ cdecl SetCursor(ptr) X11DRV_SetCursor @ cdecl SetCursor(ptr) X11DRV_SetCursor
@ cdecl GetCursorPos(ptr) X11DRV_GetCursorPos @ cdecl GetCursorPos(ptr) X11DRV_GetCursorPos
@ cdecl SetCursorPos(long long) X11DRV_SetCursorPos @ cdecl SetCursorPos(long long) X11DRV_SetCursorPos
......
...@@ -394,6 +394,8 @@ static BOOL process_attach(void) ...@@ -394,6 +394,8 @@ static BOOL process_attach(void)
X11DRV_XF86DGA2_Init(); X11DRV_XF86DGA2_Init();
#endif #endif
X11DRV_InitKeyboard();
return TRUE; return TRUE;
} }
......
...@@ -95,10 +95,6 @@ extern BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL ); ...@@ -95,10 +95,6 @@ extern BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL );
extern HWND *WIN_ListChildren( HWND hwnd ); extern HWND *WIN_ListChildren( HWND hwnd );
extern void MDI_CalcDefaultChildPos( HWND hwndClient, INT total, LPPOINT lpPos, INT delta, UINT *id ); extern void MDI_CalcDefaultChildPos( HWND hwndClient, INT total, LPPOINT lpPos, INT delta, UINT *id );
/* internal SendInput codes (FIXME) */
#define WINE_INTERNAL_INPUT_MOUSE (16+INPUT_MOUSE)
#define WINE_INTERNAL_INPUT_KEYBOARD (16+INPUT_KEYBOARD)
/* user lock */ /* user lock */
extern void USER_Lock(void); extern void USER_Lock(void);
extern void USER_Unlock(void); extern void USER_Unlock(void);
......
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