forked from Mirrors/wine-wine
user32: Remove unused GetAsyncKeyState() driver entry.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>stable
parent
f4d6df8947
commit
ae7531f673
|
@ -106,7 +106,6 @@ static const USER_DRIVER *load_driver(void)
|
|||
|
||||
GET_USER_FUNC(ActivateKeyboardLayout);
|
||||
GET_USER_FUNC(Beep);
|
||||
GET_USER_FUNC(GetAsyncKeyState);
|
||||
GET_USER_FUNC(GetKeyNameText);
|
||||
GET_USER_FUNC(GetKeyboardLayout);
|
||||
GET_USER_FUNC(GetKeyboardLayoutList);
|
||||
|
@ -206,11 +205,6 @@ static void CDECL nulldrv_Beep(void)
|
|||
{
|
||||
}
|
||||
|
||||
static SHORT CDECL nulldrv_GetAsyncKeyState( INT key )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static UINT CDECL nulldrv_GetKeyboardLayoutList( INT size, HKL *layouts )
|
||||
{
|
||||
HKEY hKeyKeyboard;
|
||||
|
@ -494,7 +488,6 @@ static USER_DRIVER null_driver =
|
|||
/* keyboard functions */
|
||||
nulldrv_ActivateKeyboardLayout,
|
||||
nulldrv_Beep,
|
||||
nulldrv_GetAsyncKeyState,
|
||||
nulldrv_GetKeyNameText,
|
||||
nulldrv_GetKeyboardLayout,
|
||||
nulldrv_GetKeyboardLayoutList,
|
||||
|
@ -566,11 +559,6 @@ static void CDECL loaderdrv_Beep(void)
|
|||
load_driver()->pBeep();
|
||||
}
|
||||
|
||||
static SHORT CDECL loaderdrv_GetAsyncKeyState( INT key )
|
||||
{
|
||||
return load_driver()->pGetAsyncKeyState( key );
|
||||
}
|
||||
|
||||
static INT CDECL loaderdrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
|
||||
{
|
||||
return load_driver()->pGetKeyNameText( lparam, buffer, size );
|
||||
|
@ -715,7 +703,6 @@ static USER_DRIVER lazy_load_driver =
|
|||
/* keyboard functions */
|
||||
loaderdrv_ActivateKeyboardLayout,
|
||||
loaderdrv_Beep,
|
||||
loaderdrv_GetAsyncKeyState,
|
||||
loaderdrv_GetKeyNameText,
|
||||
loaderdrv_GetKeyboardLayout,
|
||||
loaderdrv_GetKeyboardLayoutList,
|
||||
|
|
|
@ -401,51 +401,47 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key )
|
|||
|
||||
check_for_events( QS_INPUT );
|
||||
|
||||
if ((ret = USER_Driver->pGetAsyncKeyState( key )) == -1)
|
||||
if (key_state_info && !(key_state_info->state[key] & 0xc0) &&
|
||||
key_state_info->counter == counter && GetTickCount() - key_state_info->time < 50)
|
||||
{
|
||||
if (key_state_info &&
|
||||
!(key_state_info->state[key] & 0xc0) &&
|
||||
key_state_info->counter == counter &&
|
||||
GetTickCount() - key_state_info->time < 50)
|
||||
{
|
||||
/* use cached value */
|
||||
return 0;
|
||||
}
|
||||
else if (!key_state_info)
|
||||
{
|
||||
key_state_info = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*key_state_info) );
|
||||
get_user_thread_info()->key_state = key_state_info;
|
||||
}
|
||||
/* use cached value */
|
||||
return 0;
|
||||
}
|
||||
else if (!key_state_info)
|
||||
{
|
||||
key_state_info = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*key_state_info) );
|
||||
get_user_thread_info()->key_state = key_state_info;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
SERVER_START_REQ( get_key_state )
|
||||
ret = 0;
|
||||
SERVER_START_REQ( get_key_state )
|
||||
{
|
||||
req->tid = 0;
|
||||
req->key = key;
|
||||
if (key_state_info)
|
||||
{
|
||||
req->tid = 0;
|
||||
req->key = key;
|
||||
prev_key_state = key_state_info->state[key];
|
||||
wine_server_set_reply( req, key_state_info->state, sizeof(key_state_info->state) );
|
||||
}
|
||||
if (!wine_server_call( req ))
|
||||
{
|
||||
if (reply->state & 0x40) ret |= 0x0001;
|
||||
if (reply->state & 0x80) ret |= 0x8000;
|
||||
if (key_state_info)
|
||||
{
|
||||
prev_key_state = key_state_info->state[key];
|
||||
wine_server_set_reply( req, key_state_info->state, sizeof(key_state_info->state) );
|
||||
}
|
||||
if (!wine_server_call( req ))
|
||||
{
|
||||
if (reply->state & 0x40) ret |= 0x0001;
|
||||
if (reply->state & 0x80) ret |= 0x8000;
|
||||
if (key_state_info)
|
||||
{
|
||||
/* force refreshing the key state cache - some multithreaded programs
|
||||
* (like Adobe Photoshop CS5) expect that changes to the async key state
|
||||
* are also immediately available in other threads. */
|
||||
if (prev_key_state != key_state_info->state[key])
|
||||
counter = interlocked_xchg_add( &global_key_state_counter, 1 ) + 1;
|
||||
/* force refreshing the key state cache - some multithreaded programs
|
||||
* (like Adobe Photoshop CS5) expect that changes to the async key state
|
||||
* are also immediately available in other threads. */
|
||||
if (prev_key_state != key_state_info->state[key])
|
||||
counter = interlocked_xchg_add( &global_key_state_counter, 1 ) + 1;
|
||||
|
||||
key_state_info->time = GetTickCount();
|
||||
key_state_info->counter = counter;
|
||||
}
|
||||
key_state_info->time = GetTickCount();
|
||||
key_state_info->counter = counter;
|
||||
}
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ typedef struct tagUSER_DRIVER {
|
|||
/* keyboard functions */
|
||||
HKL (CDECL *pActivateKeyboardLayout)(HKL, UINT);
|
||||
void (CDECL *pBeep)(void);
|
||||
SHORT (CDECL *pGetAsyncKeyState)(INT);
|
||||
INT (CDECL *pGetKeyNameText)(LONG, LPWSTR, INT);
|
||||
HKL (CDECL *pGetKeyboardLayout)(DWORD);
|
||||
UINT (CDECL *pGetKeyboardLayoutList)(INT, HKL *);
|
||||
|
|
Loading…
Reference in New Issue