Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
dd138e31
Commit
dd138e31
authored
Oct 29, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 29, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up user32/input.c test, remove the wrong assumption that a
window always receives input focus upon creation.
parent
fc619d04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
24 deletions
+28
-24
input.c
dlls/user/tests/input.c
+28
-24
No files found.
dlls/user/tests/input.c
View file @
dd138e31
...
...
@@ -46,15 +46,18 @@
#define _WIN32_WINNT 0x401
#include "wine/test.h"
#include <stdarg.h>
#include <assert.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include
<assert.h>
#include
"wine/test.h"
/* globals */
HWND
hWndTest
;
long
timetag
=
0x10000000
;
static
HWND
hWndTest
;
static
long
timetag
=
0x10000000
;
static
UINT
(
WINAPI
*
ptr_SendInput
)
(
UINT
,
INPUT
*
,
size_t
);
...
...
@@ -70,13 +73,13 @@ static const char *MSGNAME[]={"WM_KEYDOWN", "WM_KEYUP", "WM_CHAR","WM_DEADCHAR",
typedef
enum
KEVtag
{
ALTDOWN
=
1
,
ALTUP
,
XDOWN
,
XUP
,
SHIFTDOWN
,
SHIFTUP
,
CTRLDOWN
,
CTRLUP
}
KEV
;
/* matching VK's */
int
GETVKEY
[]
=
{
0
,
VK_MENU
,
VK_MENU
,
'X'
,
'X'
,
VK_SHIFT
,
VK_SHIFT
,
VK_CONTROL
,
VK_CONTROL
};
static
const
int
GETVKEY
[]
=
{
0
,
VK_MENU
,
VK_MENU
,
'X'
,
'X'
,
VK_SHIFT
,
VK_SHIFT
,
VK_CONTROL
,
VK_CONTROL
};
/* matching scan codes */
int
GETSCAN
[]
=
{
0
,
0x38
,
0x38
,
0x2D
,
0x2D
,
0x2A
,
0x2A
,
0x1D
,
0x1D
};
static
const
int
GETSCAN
[]
=
{
0
,
0x38
,
0x38
,
0x2D
,
0x2D
,
0x2A
,
0x2A
,
0x1D
,
0x1D
};
/* matching updown events */
int
GETUPDOWN
[]
=
{
0
,
0
,
KEYEVENTF_KEYUP
,
0
,
KEYEVENTF_KEYUP
,
0
,
KEYEVENTF_KEYUP
,
0
,
KEYEVENTF_KEYUP
};
static
const
int
GETUPDOWN
[]
=
{
0
,
0
,
KEYEVENTF_KEYUP
,
0
,
KEYEVENTF_KEYUP
,
0
,
KEYEVENTF_KEYUP
,
0
,
KEYEVENTF_KEYUP
};
/* matching descripts */
char
*
getdesc
[]
=
{
""
,
"+alt"
,
"-alt"
,
"+X"
,
"-X"
,
"+shift"
,
"-shift"
,
"+ctrl"
,
"-ctrl"
};
static
const
char
*
getdesc
[]
=
{
""
,
"+alt"
,
"-alt"
,
"+X"
,
"-X"
,
"+shift"
,
"-shift"
,
"+ctrl"
,
"-ctrl"
};
/* The MSVC headers ignore our NONAMELESSUNION requests so we have to define our own type */
typedef
struct
...
...
@@ -110,7 +113,8 @@ typedef struct {
* the software will make all combinations of the
* keyevent defined here
*/
struct
{
int
nrkev
;
static
const
struct
{
int
nrkev
;
KEV
keydwn
[
MAXKEYEVENTS
];
KEV
keyup
[
MAXKEYEVENTS
];
}
testkeyset
[]
=
{
...
...
@@ -123,9 +127,9 @@ struct { int nrkev;
/**********************adapted from input.c **********************************/
BYTE
InputKeyStateTable
[
256
];
BYTE
AsyncKeyStateTable
[
256
];
BYTE
TrackSysKey
=
0
;
/* determine whether ALT key up will cause a WM_SYSKEYUP
static
BYTE
InputKeyStateTable
[
256
];
static
BYTE
AsyncKeyStateTable
[
256
];
static
BYTE
TrackSysKey
=
0
;
/* determine whether ALT key up will cause a WM_SYSKEYUP
or a WM_KEYUP message */
typedef
union
{
...
...
@@ -143,7 +147,7 @@ typedef union
unsigned
long
lp2
;
}
KEYLP
;
int
KbdMessage
(
KEV
kev
,
WPARAM
*
pwParam
,
LPARAM
*
plParam
)
static
int
KbdMessage
(
KEV
kev
,
WPARAM
*
pwParam
,
LPARAM
*
plParam
)
{
UINT
message
;
int
VKey
=
GETVKEY
[
kev
];
...
...
@@ -203,7 +207,7 @@ int KbdMessage( KEV kev, WPARAM *pwParam, LPARAM *plParam )
* . retrieve the messages from the input queue
* . verify
*/
void
do_test
(
HWND
hwnd
,
int
seqnr
,
KEV
td
[]
)
static
void
do_test
(
HWND
hwnd
,
int
seqnr
,
const
KEV
td
[]
)
{
HMODULE
module
;
INPUT
inputs
[
MAXKEYEVENTS
];
...
...
@@ -254,7 +258,7 @@ void do_test( HWND hwnd, int seqnr, KEV td[] )
}
/* test all combinations of the specified key events */
void
TestASet
(
HWND
hWnd
,
int
nrkev
,
KEV
kevdwn
[],
KEV
kevup
[]
)
static
void
TestASet
(
HWND
hWnd
,
int
nrkev
,
const
KEV
kevdwn
[],
const
KEV
kevup
[]
)
{
int
i
,
j
,
k
,
l
,
m
,
n
;
static
int
count
=
0
;
...
...
@@ -302,24 +306,23 @@ void TestASet( HWND hWnd, int nrkev, KEV kevdwn[], KEV kevup[] )
}
/* test each set specified in the global testkeyset array */
void
TestSysKeys
(
HWND
hWnd
)
static
void
TestSysKeys
(
HWND
hWnd
)
{
int
i
;
for
(
i
=
0
;
testkeyset
[
i
].
nrkev
;
i
++
)
TestASet
(
hWnd
,
testkeyset
[
i
].
nrkev
,
testkeyset
[
i
].
keydwn
,
testkeyset
[
i
].
keyup
);
}
static
LRESULT
CALLBACK
WndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
msg
)
{
case
WM_SETFOCUS
:
case
WM_USER
:
SetFocus
(
hWnd
);
/* window has focus, now do the test */
if
(
hWnd
==
hWndTest
)
TestSysKeys
(
hWnd
);
/* finished :-) */
DestroyWindow
(
hWnd
);
break
;
case
WM_DESTROY
:
...
...
@@ -356,9 +359,10 @@ START_TEST(input)
NULL
,
NULL
,
hInstance
,
NULL
)
);
ShowWindow
(
hWndTest
,
SW_SHOW
);
UpdateWindow
(
hWndTest
);
/* message loop */
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
DispatchMessageA
(
&
msg
);
}
/* flush pending messages */
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
SendMessageA
(
hWndTest
,
WM_USER
,
0
,
0
);
DestroyWindow
(
hWndTest
);
}
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