user32: Retrieve the key state for GetAsyncKeyState from the server.
This commit is contained in:
parent
22468ec65c
commit
a7da164949
@ -168,7 +168,7 @@ static void CDECL nulldrv_Beep(void)
|
|||||||
|
|
||||||
static SHORT CDECL nulldrv_GetAsyncKeyState( INT key )
|
static SHORT CDECL nulldrv_GetAsyncKeyState( INT key )
|
||||||
{
|
{
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT CDECL nulldrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
|
static INT CDECL nulldrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
|
||||||
|
@ -300,11 +300,28 @@ HWND WINAPI GetCapture(void)
|
|||||||
* bit set to 1 if currently pressed, low-order bit set to 1 if key has
|
* bit set to 1 if currently pressed, low-order bit set to 1 if key has
|
||||||
* been pressed.
|
* been pressed.
|
||||||
*/
|
*/
|
||||||
SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState(INT nKey)
|
SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key )
|
||||||
{
|
{
|
||||||
if (nKey < 0 || nKey > 256)
|
SHORT ret;
|
||||||
return 0;
|
|
||||||
return USER_Driver->pGetAsyncKeyState( nKey );
|
if (key < 0 || key >= 256) return 0;
|
||||||
|
|
||||||
|
if ((ret = USER_Driver->pGetAsyncKeyState( key )) == -1)
|
||||||
|
{
|
||||||
|
ret = 0;
|
||||||
|
SERVER_START_REQ( get_key_state )
|
||||||
|
{
|
||||||
|
req->tid = 0;
|
||||||
|
req->key = key;
|
||||||
|
if (!wine_server_call( req ))
|
||||||
|
{
|
||||||
|
if (reply->state & 0x40) ret |= 0x0001;
|
||||||
|
if (reply->state & 0x80) ret |= 0x8000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SERVER_END_REQ;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ WINE_DECLARE_DEBUG_CHANNEL(key);
|
|||||||
0x40 -> key got pressed since last time
|
0x40 -> key got pressed since last time
|
||||||
0x01 -> key is toggled
|
0x01 -> key is toggled
|
||||||
*/
|
*/
|
||||||
BYTE key_state_table[256];
|
static BYTE key_state_table[256];
|
||||||
|
|
||||||
static BYTE TrackSysKey = 0; /* determine whether ALT key up will cause a WM_SYSKEYUP
|
static BYTE TrackSysKey = 0; /* determine whether ALT key up will cause a WM_SYSKEYUP
|
||||||
or a WM_KEYUP message */
|
or a WM_KEYUP message */
|
||||||
@ -1968,16 +1968,9 @@ static BOOL match_x11_keyboard_layout(HKL hkl)
|
|||||||
*/
|
*/
|
||||||
SHORT CDECL X11DRV_GetAsyncKeyState(INT key)
|
SHORT CDECL X11DRV_GetAsyncKeyState(INT key)
|
||||||
{
|
{
|
||||||
SHORT retval;
|
|
||||||
|
|
||||||
/* Photoshop livelocks unless mouse events are included here */
|
/* Photoshop livelocks unless mouse events are included here */
|
||||||
X11DRV_MsgWaitForMultipleObjectsEx( 0, NULL, 0, QS_KEY | QS_MOUSE, 0 );
|
X11DRV_MsgWaitForMultipleObjectsEx( 0, NULL, 0, QS_KEY | QS_MOUSE, 0 );
|
||||||
|
return -1;
|
||||||
retval = ((key_state_table[key] & 0x40) ? 0x0001 : 0) |
|
|
||||||
((key_state_table[key] & 0x80) ? 0x8000 : 0);
|
|
||||||
key_state_table[key] &= ~0x40;
|
|
||||||
TRACE_(key)("(%X) -> %x\n", key, retval);
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -398,59 +398,33 @@ void X11DRV_send_mouse_input( HWND hwnd, DWORD flags, DWORD x, DWORD y,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags & MOUSEEVENTF_LEFTDOWN)
|
if (flags & MOUSEEVENTF_LEFTDOWN)
|
||||||
{
|
|
||||||
key_state_table[VK_LBUTTON] |= 0xc0;
|
|
||||||
queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_RBUTTONDOWN : WM_LBUTTONDOWN,
|
queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_RBUTTONDOWN : WM_LBUTTONDOWN,
|
||||||
hwnd, pt.x, pt.y, data, time, extra_info, injected_flags );
|
hwnd, pt.x, pt.y, data, time, extra_info, injected_flags );
|
||||||
}
|
|
||||||
if (flags & MOUSEEVENTF_LEFTUP)
|
if (flags & MOUSEEVENTF_LEFTUP)
|
||||||
{
|
|
||||||
key_state_table[VK_LBUTTON] &= ~0x80;
|
|
||||||
queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_RBUTTONUP : WM_LBUTTONUP,
|
queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_RBUTTONUP : WM_LBUTTONUP,
|
||||||
hwnd, pt.x, pt.y, data, time, extra_info, injected_flags );
|
hwnd, pt.x, pt.y, data, time, extra_info, injected_flags );
|
||||||
}
|
|
||||||
if (flags & MOUSEEVENTF_RIGHTDOWN)
|
if (flags & MOUSEEVENTF_RIGHTDOWN)
|
||||||
{
|
|
||||||
key_state_table[VK_RBUTTON] |= 0xc0;
|
|
||||||
queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_LBUTTONDOWN : WM_RBUTTONDOWN,
|
queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_LBUTTONDOWN : WM_RBUTTONDOWN,
|
||||||
hwnd, pt.x, pt.y, data, time, extra_info, injected_flags );
|
hwnd, pt.x, pt.y, data, time, extra_info, injected_flags );
|
||||||
}
|
|
||||||
if (flags & MOUSEEVENTF_RIGHTUP)
|
if (flags & MOUSEEVENTF_RIGHTUP)
|
||||||
{
|
|
||||||
key_state_table[VK_RBUTTON] &= ~0x80;
|
|
||||||
queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_LBUTTONUP : WM_RBUTTONUP,
|
queue_raw_mouse_message( GetSystemMetrics(SM_SWAPBUTTON) ? WM_LBUTTONUP : WM_RBUTTONUP,
|
||||||
hwnd, pt.x, pt.y, data, time, extra_info, injected_flags );
|
hwnd, pt.x, pt.y, data, time, extra_info, injected_flags );
|
||||||
}
|
|
||||||
if (flags & MOUSEEVENTF_MIDDLEDOWN)
|
if (flags & MOUSEEVENTF_MIDDLEDOWN)
|
||||||
{
|
|
||||||
key_state_table[VK_MBUTTON] |= 0xc0;
|
|
||||||
queue_raw_mouse_message( WM_MBUTTONDOWN, hwnd, pt.x, pt.y,
|
queue_raw_mouse_message( WM_MBUTTONDOWN, hwnd, pt.x, pt.y,
|
||||||
data, time, extra_info, injected_flags );
|
data, time, extra_info, injected_flags );
|
||||||
}
|
|
||||||
if (flags & MOUSEEVENTF_MIDDLEUP)
|
if (flags & MOUSEEVENTF_MIDDLEUP)
|
||||||
{
|
|
||||||
key_state_table[VK_MBUTTON] &= ~0x80;
|
|
||||||
queue_raw_mouse_message( WM_MBUTTONUP, hwnd, pt.x, pt.y,
|
queue_raw_mouse_message( WM_MBUTTONUP, hwnd, pt.x, pt.y,
|
||||||
data, time, extra_info, injected_flags );
|
data, time, extra_info, injected_flags );
|
||||||
}
|
|
||||||
if (flags & MOUSEEVENTF_WHEEL)
|
if (flags & MOUSEEVENTF_WHEEL)
|
||||||
{
|
|
||||||
queue_raw_mouse_message( WM_MOUSEWHEEL, hwnd, pt.x, pt.y,
|
queue_raw_mouse_message( WM_MOUSEWHEEL, hwnd, pt.x, pt.y,
|
||||||
data, time, extra_info, injected_flags );
|
data, time, extra_info, injected_flags );
|
||||||
}
|
|
||||||
if (flags & MOUSEEVENTF_XDOWN)
|
if (flags & MOUSEEVENTF_XDOWN)
|
||||||
{
|
|
||||||
key_state_table[VK_XBUTTON1 + data - 1] |= 0xc0;
|
|
||||||
queue_raw_mouse_message( WM_XBUTTONDOWN, hwnd, pt.x, pt.y,
|
queue_raw_mouse_message( WM_XBUTTONDOWN, hwnd, pt.x, pt.y,
|
||||||
data, time, extra_info, injected_flags );
|
data, time, extra_info, injected_flags );
|
||||||
}
|
|
||||||
if (flags & MOUSEEVENTF_XUP)
|
if (flags & MOUSEEVENTF_XUP)
|
||||||
{
|
|
||||||
key_state_table[VK_XBUTTON1 + data - 1] &= ~0x80;
|
|
||||||
queue_raw_mouse_message( WM_XBUTTONUP, hwnd, pt.x, pt.y,
|
queue_raw_mouse_message( WM_XBUTTONUP, hwnd, pt.x, pt.y,
|
||||||
data, time, extra_info, injected_flags );
|
data, time, extra_info, injected_flags );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef SONAME_LIBXCURSOR
|
#ifdef SONAME_LIBXCURSOR
|
||||||
|
|
||||||
|
@ -609,7 +609,6 @@ extern int alloc_system_colors;
|
|||||||
extern int xrender_error_base;
|
extern int xrender_error_base;
|
||||||
extern HMODULE x11drv_module;
|
extern HMODULE x11drv_module;
|
||||||
|
|
||||||
extern BYTE key_state_table[256];
|
|
||||||
extern POINT cursor_pos;
|
extern POINT cursor_pos;
|
||||||
|
|
||||||
/* atoms */
|
/* atoms */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user