Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a7da1649
Commit
a7da1649
authored
Feb 28, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Retrieve the key state for GetAsyncKeyState from the server.
parent
22468ec6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
41 deletions
+24
-41
driver.c
dlls/user32/driver.c
+1
-1
input.c
dlls/user32/input.c
+21
-4
keyboard.c
dlls/winex11.drv/keyboard.c
+2
-9
mouse.c
dlls/winex11.drv/mouse.c
+0
-26
x11drv.h
dlls/winex11.drv/x11drv.h
+0
-1
No files found.
dlls/user32/driver.c
View file @
a7da1649
...
...
@@ -168,7 +168,7 @@ static void CDECL nulldrv_Beep(void)
static
SHORT
CDECL
nulldrv_GetAsyncKeyState
(
INT
key
)
{
return
0
;
return
-
1
;
}
static
INT
CDECL
nulldrv_GetKeyNameText
(
LONG
lparam
,
LPWSTR
buffer
,
INT
size
)
...
...
dlls/user32/input.c
View file @
a7da1649
...
...
@@ -300,11 +300,28 @@ HWND WINAPI GetCapture(void)
* bit set to 1 if currently pressed, low-order bit set to 1 if key has
* been pressed.
*/
SHORT
WINAPI
DECLSPEC_HOTPATCH
GetAsyncKeyState
(
INT
nKey
)
SHORT
WINAPI
DECLSPEC_HOTPATCH
GetAsyncKeyState
(
INT
key
)
{
if
(
nKey
<
0
||
nKey
>
256
)
return
0
;
return
USER_Driver
->
pGetAsyncKeyState
(
nKey
);
SHORT
ret
;
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
;
}
...
...
dlls/winex11.drv/keyboard.c
View file @
a7da1649
...
...
@@ -65,7 +65,7 @@ WINE_DECLARE_DEBUG_CHANNEL(key);
0x40 -> key got pressed since last time
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
or a WM_KEYUP message */
...
...
@@ -1968,16 +1968,9 @@ static BOOL match_x11_keyboard_layout(HKL hkl)
*/
SHORT
CDECL
X11DRV_GetAsyncKeyState
(
INT
key
)
{
SHORT
retval
;
/* Photoshop livelocks unless mouse events are included here */
X11DRV_MsgWaitForMultipleObjectsEx
(
0
,
NULL
,
0
,
QS_KEY
|
QS_MOUSE
,
0
);
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
;
return
-
1
;
}
...
...
dlls/winex11.drv/mouse.c
View file @
a7da1649
...
...
@@ -398,58 +398,32 @@ void X11DRV_send_mouse_input( HWND hwnd, DWORD flags, DWORD x, DWORD y,
}
}
if
(
flags
&
MOUSEEVENTF_LEFTDOWN
)
{
key_state_table
[
VK_LBUTTON
]
|=
0xc0
;
queue_raw_mouse_message
(
GetSystemMetrics
(
SM_SWAPBUTTON
)
?
WM_RBUTTONDOWN
:
WM_LBUTTONDOWN
,
hwnd
,
pt
.
x
,
pt
.
y
,
data
,
time
,
extra_info
,
injected_flags
);
}
if
(
flags
&
MOUSEEVENTF_LEFTUP
)
{
key_state_table
[
VK_LBUTTON
]
&=
~
0x80
;
queue_raw_mouse_message
(
GetSystemMetrics
(
SM_SWAPBUTTON
)
?
WM_RBUTTONUP
:
WM_LBUTTONUP
,
hwnd
,
pt
.
x
,
pt
.
y
,
data
,
time
,
extra_info
,
injected_flags
);
}
if
(
flags
&
MOUSEEVENTF_RIGHTDOWN
)
{
key_state_table
[
VK_RBUTTON
]
|=
0xc0
;
queue_raw_mouse_message
(
GetSystemMetrics
(
SM_SWAPBUTTON
)
?
WM_LBUTTONDOWN
:
WM_RBUTTONDOWN
,
hwnd
,
pt
.
x
,
pt
.
y
,
data
,
time
,
extra_info
,
injected_flags
);
}
if
(
flags
&
MOUSEEVENTF_RIGHTUP
)
{
key_state_table
[
VK_RBUTTON
]
&=
~
0x80
;
queue_raw_mouse_message
(
GetSystemMetrics
(
SM_SWAPBUTTON
)
?
WM_LBUTTONUP
:
WM_RBUTTONUP
,
hwnd
,
pt
.
x
,
pt
.
y
,
data
,
time
,
extra_info
,
injected_flags
);
}
if
(
flags
&
MOUSEEVENTF_MIDDLEDOWN
)
{
key_state_table
[
VK_MBUTTON
]
|=
0xc0
;
queue_raw_mouse_message
(
WM_MBUTTONDOWN
,
hwnd
,
pt
.
x
,
pt
.
y
,
data
,
time
,
extra_info
,
injected_flags
);
}
if
(
flags
&
MOUSEEVENTF_MIDDLEUP
)
{
key_state_table
[
VK_MBUTTON
]
&=
~
0x80
;
queue_raw_mouse_message
(
WM_MBUTTONUP
,
hwnd
,
pt
.
x
,
pt
.
y
,
data
,
time
,
extra_info
,
injected_flags
);
}
if
(
flags
&
MOUSEEVENTF_WHEEL
)
{
queue_raw_mouse_message
(
WM_MOUSEWHEEL
,
hwnd
,
pt
.
x
,
pt
.
y
,
data
,
time
,
extra_info
,
injected_flags
);
}
if
(
flags
&
MOUSEEVENTF_XDOWN
)
{
key_state_table
[
VK_XBUTTON1
+
data
-
1
]
|=
0xc0
;
queue_raw_mouse_message
(
WM_XBUTTONDOWN
,
hwnd
,
pt
.
x
,
pt
.
y
,
data
,
time
,
extra_info
,
injected_flags
);
}
if
(
flags
&
MOUSEEVENTF_XUP
)
{
key_state_table
[
VK_XBUTTON1
+
data
-
1
]
&=
~
0x80
;
queue_raw_mouse_message
(
WM_XBUTTONUP
,
hwnd
,
pt
.
x
,
pt
.
y
,
data
,
time
,
extra_info
,
injected_flags
);
}
}
#ifdef SONAME_LIBXCURSOR
...
...
dlls/winex11.drv/x11drv.h
View file @
a7da1649
...
...
@@ -609,7 +609,6 @@ extern int alloc_system_colors;
extern
int
xrender_error_base
;
extern
HMODULE
x11drv_module
;
extern
BYTE
key_state_table
[
256
];
extern
POINT
cursor_pos
;
/* atoms */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment