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
ba923199
Commit
ba923199
authored
Jun 17, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Jun 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Test that hotkeys are really replaced when using the same id/hwnd.
parent
4f58e116
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
msg.c
dlls/user32/tests/msg.c
+48
-0
No files found.
dlls/user32/tests/msg.c
View file @
ba923199
...
...
@@ -13094,6 +13094,29 @@ static const struct message WmHotkeyCombined[] = {
{
WM_KEYUP
,
sent
|
wparam
|
lparam
,
VK_LWIN
,
0xc0000001
},
{
0
}
};
static
const
struct
message
WmHotkeyPrevious
[]
=
{
{
WM_KEYDOWN
,
kbd_hook
|
wparam
|
lparam
,
VK_LWIN
,
LLKHF_INJECTED
},
{
WM_KEYDOWN
,
kbd_hook
|
lparam
,
0
,
LLKHF_INJECTED
},
{
WM_KEYUP
,
kbd_hook
|
lparam
,
0
,
LLKHF_INJECTED
|
LLKHF_UP
},
{
WM_KEYUP
,
kbd_hook
|
wparam
|
lparam
,
VK_LWIN
,
LLKHF_INJECTED
|
LLKHF_UP
},
{
HCBT_KEYSKIPPED
,
hook
|
wparam
|
lparam
|
optional
,
VK_LWIN
,
1
},
{
WM_KEYDOWN
,
sent
|
wparam
|
lparam
,
VK_LWIN
,
1
},
{
HCBT_KEYSKIPPED
,
hook
|
lparam
|
optional
,
0
,
1
},
{
WM_KEYDOWN
,
sent
|
lparam
,
0
,
1
},
{
HCBT_KEYSKIPPED
,
hook
|
optional
|
lparam
,
0
,
0xc0000001
},
{
WM_KEYUP
,
sent
|
lparam
,
0
,
0xc0000001
},
{
HCBT_KEYSKIPPED
,
hook
|
wparam
|
lparam
|
optional
,
VK_LWIN
,
0xc0000001
},
{
WM_KEYUP
,
sent
|
wparam
|
lparam
,
VK_LWIN
,
0xc0000001
},
{
0
}
};
static
const
struct
message
WmHotkeyNew
[]
=
{
{
WM_KEYDOWN
,
kbd_hook
|
lparam
,
0
,
LLKHF_INJECTED
},
{
WM_KEYUP
,
kbd_hook
|
lparam
,
0
,
LLKHF_INJECTED
|
LLKHF_UP
},
{
WM_HOTKEY
,
sent
|
wparam
,
5
},
{
HCBT_KEYSKIPPED
,
hook
|
optional
,
0
,
0x80000001
},
{
WM_KEYUP
,
sent
,
0
,
0x80000001
},
/* lparam not checked so the sequence isn't a todo */
{
0
}
};
static
int
hotkey_letter
;
...
...
@@ -13261,6 +13284,31 @@ static void test_hotkey(void)
ret
=
RegisterHotKey
(
test_window
,
5
,
0
,
hotkey_letter
);
ok
(
ret
==
TRUE
,
"expected TRUE, got %i, err=%d
\n
"
,
ret
,
GetLastError
());
/* Previous key combination does not work */
keybd_event
(
VK_LWIN
,
0
,
0
,
0
);
keybd_event
(
hotkey_letter
,
0
,
0
,
0
);
keybd_event
(
hotkey_letter
,
0
,
KEYEVENTF_KEYUP
,
0
);
keybd_event
(
VK_LWIN
,
0
,
KEYEVENTF_KEYUP
,
0
);
while
(
PeekMessage
(
&
msg
,
NULL
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
ok_sequence
(
WmHotkeyPrevious
,
"window hotkey previous"
,
FALSE
);
/* New key combination works */
keybd_event
(
hotkey_letter
,
0
,
0
,
0
);
keybd_event
(
hotkey_letter
,
0
,
KEYEVENTF_KEYUP
,
0
);
while
(
PeekMessage
(
&
msg
,
NULL
,
0
,
0
,
PM_REMOVE
))
{
if
(
msg
.
message
==
WM_HOTKEY
)
{
ok
(
msg
.
hwnd
==
test_window
,
"unexpected hwnd %p
\n
"
,
msg
.
hwnd
);
ok
(
msg
.
lParam
==
MAKELPARAM
(
0
,
hotkey_letter
),
"unexpected WM_HOTKEY lparam %lx
\n
"
,
msg
.
lParam
);
}
DispatchMessage
(
&
msg
);
}
ok_sequence
(
WmHotkeyNew
,
"window hotkey new"
,
FALSE
);
/* Unregister hotkey properly */
ret
=
UnregisterHotKey
(
test_window
,
5
);
ok
(
ret
==
TRUE
,
"expected TRUE, got %i, err=%d
\n
"
,
ret
,
GetLastError
());
...
...
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