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
4b13f859
Commit
4b13f859
authored
Jul 01, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Use SendInput() directly.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
84a46a27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
18 deletions
+11
-18
input.c
dlls/user32/tests/input.c
+11
-18
No files found.
dlls/user32/tests/input.c
View file @
4b13f859
...
...
@@ -76,7 +76,6 @@ static struct {
BOOL
sendinput_broken
;
}
key_status
;
static
UINT
(
WINAPI
*
pSendInput
)
(
UINT
,
INPUT
*
,
size_t
);
static
BOOL
(
WINAPI
*
pGetCurrentInputMessageSource
)(
INPUT_MESSAGE_SOURCE
*
source
);
static
BOOL
(
WINAPI
*
pGetPointerType
)(
UINT32
,
POINTER_INPUT_TYPE
*
);
static
int
(
WINAPI
*
pGetMouseMovePointsEx
)
(
UINT
,
LPMOUSEMOVEPOINT
,
LPMOUSEMOVEPOINT
,
int
,
DWORD
);
...
...
@@ -163,7 +162,6 @@ static void init_function_pointers(void)
if (!(p ## func = (void*)GetProcAddress(hdll, #func))) \
trace("GetProcAddress(%s) failed\n", #func)
GET_PROC
(
SendInput
);
GET_PROC
(
GetCurrentInputMessageSource
);
GET_PROC
(
GetMouseMovePointsEx
);
GET_PROC
(
GetPointerType
);
...
...
@@ -249,7 +247,7 @@ static BOOL do_test( HWND hwnd, int seqnr, const KEV td[] )
for
(
kmctr
=
0
;
kmctr
<
MAXKEYEVENTS
&&
expmsg
[
kmctr
].
message
;
kmctr
++
)
;
ok
(
evtctr
<=
MAXKEYEVENTS
,
"evtctr is above MAXKEYEVENTS
\n
"
);
if
(
evtctr
!=
p
SendInput
(
evtctr
,
&
inputs
[
0
],
sizeof
(
INPUT
)))
if
(
evtctr
!=
SendInput
(
evtctr
,
&
inputs
[
0
],
sizeof
(
INPUT
)))
ok
(
FALSE
,
"SendInput failed to send some events
\n
"
);
i
=
0
;
if
(
winetest_debug
>
1
)
...
...
@@ -954,7 +952,7 @@ static void test_Input_blackbox(void)
i
.
u
.
ki
.
wScan
=
ii
+
1
/* useful for debugging */
;
i
.
u
.
ki
.
dwFlags
=
sendinput_test
[
ii
].
dwFlags
;
i
.
u
.
ki
.
wVk
=
sendinput_test
[
ii
].
wVk
;
p
SendInput
(
1
,
(
INPUT
*
)
&
i
,
sizeof
(
TEST_INPUT
));
SendInput
(
1
,
(
INPUT
*
)
&
i
,
sizeof
(
TEST_INPUT
));
empty_message_queue
();
GetKeyboardState
(
ks2
);
compare_and_check
(
ii
,
ks1
,
ks2
,
&
sendinput_test
[
ii
],
foreground
);
...
...
@@ -997,7 +995,7 @@ static void test_unicode_keys(HWND hwnd, HHOOK hook)
inputs
[
0
].
u
.
ki
.
dwFlags
=
KEYEVENTF_UNICODE
;
reset_key_status
();
p
SendInput
(
1
,
(
INPUT
*
)
inputs
,
sizeof
(
INPUT
));
SendInput
(
1
,
(
INPUT
*
)
inputs
,
sizeof
(
INPUT
));
while
(
PeekMessageW
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
)){
if
(
msg
.
message
==
WM_KEYDOWN
&&
msg
.
wParam
==
VK_PACKET
){
TranslateMessage
(
&
msg
);
...
...
@@ -1019,7 +1017,7 @@ static void test_unicode_keys(HWND hwnd, HHOOK hook)
inputs
[
1
].
u
.
ki
.
dwFlags
=
KEYEVENTF_UNICODE
|
KEYEVENTF_KEYUP
;
reset_key_status
();
p
SendInput
(
1
,
(
INPUT
*
)(
inputs
+
1
),
sizeof
(
INPUT
));
SendInput
(
1
,
(
INPUT
*
)(
inputs
+
1
),
sizeof
(
INPUT
));
while
(
PeekMessageW
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
)){
if
(
msg
.
message
==
WM_KEYDOWN
&&
msg
.
wParam
==
VK_PACKET
){
TranslateMessage
(
&
msg
);
...
...
@@ -1045,7 +1043,7 @@ static void test_unicode_keys(HWND hwnd, HHOOK hook)
reset_key_status
();
key_status
.
expect_alt
=
TRUE
;
p
SendInput
(
2
,
(
INPUT
*
)
inputs
,
sizeof
(
INPUT
));
SendInput
(
2
,
(
INPUT
*
)
inputs
,
sizeof
(
INPUT
));
while
(
PeekMessageW
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
)){
if
(
msg
.
message
==
WM_SYSKEYDOWN
&&
msg
.
wParam
==
VK_PACKET
){
TranslateMessage
(
&
msg
);
...
...
@@ -1072,7 +1070,7 @@ static void test_unicode_keys(HWND hwnd, HHOOK hook)
reset_key_status
();
key_status
.
expect_alt
=
TRUE
;
p
SendInput
(
2
,
(
INPUT
*
)
inputs
,
sizeof
(
INPUT
));
SendInput
(
2
,
(
INPUT
*
)
inputs
,
sizeof
(
INPUT
));
while
(
PeekMessageW
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
)){
if
(
msg
.
message
==
WM_SYSKEYDOWN
&&
msg
.
wParam
==
VK_PACKET
){
TranslateMessage
(
&
msg
);
...
...
@@ -2758,7 +2756,7 @@ static void test_input_message_source(void)
SendMessageA
(
hwnd
,
WM_KEYDOWN
,
0
,
0
);
SendMessageA
(
hwnd
,
WM_MOUSEMOVE
,
0
,
0
);
p
SendInput
(
2
,
(
INPUT
*
)
inputs
,
sizeof
(
INPUT
)
);
SendInput
(
2
,
(
INPUT
*
)
inputs
,
sizeof
(
INPUT
)
);
while
(
PeekMessageW
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
))
{
expect_src
.
deviceType
=
IMDT_KEYBOARD
;
...
...
@@ -2834,15 +2832,10 @@ START_TEST(input)
init_function_pointers
();
GetCursorPos
(
&
pos
);
if
(
pSendInput
)
{
test_Input_blackbox
();
test_Input_whitebox
();
test_Input_unicode
();
test_Input_mouse
();
}
else
win_skip
(
"SendInput is not available
\n
"
);
test_Input_blackbox
();
test_Input_whitebox
();
test_Input_unicode
();
test_Input_mouse
();
test_keynames
();
test_mouse_ll_hook
();
test_key_map
();
...
...
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