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
60008637
Commit
60008637
authored
Feb 21, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take Shift key state into account while processing an accelerator.
Add a couple of test cases.
parent
d07c7648
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
3 deletions
+66
-3
menu.c
dlls/user/menu.c
+1
-0
msg.c
dlls/user/tests/msg.c
+62
-2
resource.rc
dlls/user/tests/resource.rc
+3
-1
No files found.
dlls/user/menu.c
View file @
60008637
...
...
@@ -4531,6 +4531,7 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
if
(
GetKeyState
(
VK_CONTROL
)
&
0x8000
)
mask
|=
FCONTROL
;
if
(
GetKeyState
(
VK_MENU
)
&
0x8000
)
mask
|=
FALT
;
if
(
GetKeyState
(
VK_SHIFT
)
&
0x8000
)
mask
|=
FSHIFT
;
if
(
message
==
WM_CHAR
||
message
==
WM_SYSCHAR
)
{
...
...
dlls/user/tests/msg.c
View file @
60008637
...
...
@@ -4046,6 +4046,40 @@ static const struct message WmCtrlAltVkN[] = {
{
WM_KEYUP
,
sent
|
wparam
|
lparam
,
VK_CONTROL
,
0xc0000001
},
{
0
}
};
static
const
struct
message
WmCtrlShiftVkN
[]
=
{
{
WM_KEYDOWN
,
wparam
|
lparam
,
VK_CONTROL
,
1
},
{
WM_KEYDOWN
,
sent
|
wparam
|
lparam
,
VK_CONTROL
,
1
},
{
WM_KEYDOWN
,
wparam
|
lparam
,
VK_SHIFT
,
1
},
{
WM_KEYDOWN
,
sent
|
wparam
|
lparam
,
VK_SHIFT
,
1
},
{
WM_KEYDOWN
,
wparam
|
lparam
,
'N'
,
1
},
{
WM_COMMAND
,
sent
|
wparam
|
lparam
,
MAKEWPARAM
(
1004
,
1
),
0
},
{
WM_KEYUP
,
wparam
|
lparam
,
'N'
,
0xc0000001
},
{
WM_KEYUP
,
sent
|
wparam
|
lparam
,
'N'
,
0xc0000001
},
{
WM_KEYUP
,
wparam
|
lparam
,
VK_SHIFT
,
0xc0000001
},
{
WM_KEYUP
,
sent
|
wparam
|
lparam
,
VK_SHIFT
,
0xc0000001
},
{
WM_KEYUP
,
wparam
|
lparam
,
VK_CONTROL
,
0xc0000001
},
{
WM_KEYUP
,
sent
|
wparam
|
lparam
,
VK_CONTROL
,
0xc0000001
},
{
0
}
};
static
const
struct
message
WmCtrlAltShiftVkN
[]
=
{
{
WM_KEYDOWN
,
wparam
|
lparam
,
VK_CONTROL
,
1
},
{
WM_KEYDOWN
,
sent
|
wparam
|
lparam
,
VK_CONTROL
,
1
},
{
WM_KEYDOWN
,
wparam
|
lparam
,
VK_MENU
,
0x20000001
},
{
WM_KEYDOWN
,
sent
|
wparam
|
lparam
,
VK_MENU
,
0x20000001
},
{
WM_KEYDOWN
,
wparam
|
lparam
,
VK_SHIFT
,
0x20000001
},
{
WM_KEYDOWN
,
sent
|
wparam
|
lparam
,
VK_SHIFT
,
0x20000001
},
{
WM_KEYDOWN
,
wparam
|
lparam
,
'N'
,
0x20000001
},
{
WM_COMMAND
,
sent
|
wparam
|
lparam
,
MAKEWPARAM
(
1005
,
1
),
0
},
{
WM_KEYUP
,
wparam
|
lparam
,
'N'
,
0xe0000001
},
{
WM_KEYUP
,
sent
|
wparam
|
lparam
,
'N'
,
0xe0000001
},
{
WM_KEYUP
,
wparam
|
lparam
,
VK_SHIFT
,
0xe0000001
},
{
WM_KEYUP
,
sent
|
wparam
|
lparam
,
VK_SHIFT
,
0xe0000001
},
{
WM_KEYUP
,
wparam
|
lparam
,
VK_MENU
,
0xc0000001
},
{
WM_KEYUP
,
sent
|
wparam
|
lparam
,
VK_MENU
,
0xc0000001
},
{
WM_KEYUP
,
wparam
|
lparam
,
VK_CONTROL
,
0xc0000001
},
{
WM_KEYUP
,
sent
|
wparam
|
lparam
,
VK_CONTROL
,
0xc0000001
},
{
0
}
};
static
const
struct
message
WmAltPressRelease
[]
=
{
{
WM_SYSKEYDOWN
,
wparam
|
lparam
,
VK_MENU
,
0x20000001
},
{
WM_SYSKEYDOWN
,
sent
|
wparam
|
lparam
,
VK_MENU
,
0x20000001
},
...
...
@@ -4172,7 +4206,7 @@ static void test_accelerators(void)
pump_msg_loop
(
hwnd
,
hAccel
);
ok_sequence
(
WmAltVkN
,
"Alt+VK_N press/release"
,
FALSE
);
trace
(
"testing Ctrl+Alt+VK_N press/release
\n
"
);
trace
(
"testing Ctrl+Alt+VK_N press/release
1
\n
"
);
flush_sequence
();
keybd_event
(
VK_CONTROL
,
0
,
0
,
0
);
keybd_event
(
VK_MENU
,
0
,
0
,
0
);
...
...
@@ -4223,7 +4257,7 @@ static void test_accelerators(void)
pump_msg_loop
(
hwnd
,
hAccel
);
ok_sequence
(
WmAltVkN_2
,
"Alt+VK_N press/release 2"
,
FALSE
);
trace
(
"testing Ctrl+Alt+VK_N press/release
\n
"
);
trace
(
"testing Ctrl+Alt+VK_N press/release
2
\n
"
);
flush_sequence
();
keybd_event
(
VK_CONTROL
,
0
,
0
,
0
);
keybd_event
(
VK_MENU
,
0
,
0
,
0
);
...
...
@@ -4234,6 +4268,30 @@ static void test_accelerators(void)
pump_msg_loop
(
hwnd
,
hAccel
);
ok_sequence
(
WmCtrlAltVkN
,
"Ctrl+Alt+VK_N press/release 2"
,
FALSE
);
trace
(
"testing Ctrl+Shift+VK_N press/release
\n
"
);
flush_sequence
();
keybd_event
(
VK_CONTROL
,
0
,
0
,
0
);
keybd_event
(
VK_SHIFT
,
0
,
0
,
0
);
keybd_event
(
'N'
,
0
,
0
,
0
);
keybd_event
(
'N'
,
0
,
KEYEVENTF_KEYUP
,
0
);
keybd_event
(
VK_SHIFT
,
0
,
KEYEVENTF_KEYUP
,
0
);
keybd_event
(
VK_CONTROL
,
0
,
KEYEVENTF_KEYUP
,
0
);
pump_msg_loop
(
hwnd
,
hAccel
);
ok_sequence
(
WmCtrlShiftVkN
,
"Ctrl+Shift+VK_N press/release"
,
FALSE
);
trace
(
"testing Ctrl+Alt+Shift+VK_N press/release
\n
"
);
flush_sequence
();
keybd_event
(
VK_CONTROL
,
0
,
0
,
0
);
keybd_event
(
VK_MENU
,
0
,
0
,
0
);
keybd_event
(
VK_SHIFT
,
0
,
0
,
0
);
keybd_event
(
'N'
,
0
,
0
,
0
);
keybd_event
(
'N'
,
0
,
KEYEVENTF_KEYUP
,
0
);
keybd_event
(
VK_SHIFT
,
0
,
KEYEVENTF_KEYUP
,
0
);
keybd_event
(
VK_MENU
,
0
,
KEYEVENTF_KEYUP
,
0
);
keybd_event
(
VK_CONTROL
,
0
,
KEYEVENTF_KEYUP
,
0
);
pump_msg_loop
(
hwnd
,
hAccel
);
ok_sequence
(
WmCtrlAltShiftVkN
,
"Ctrl+Alt+Shift+VK_N press/release"
,
FALSE
);
ret
=
DestroyAcceleratorTable
(
hAccel
);
ok
(
ret
,
"DestroyAcceleratorTable error %ld
\n
"
,
GetLastError
());
...
...
@@ -5333,8 +5391,10 @@ static void test_scrollwindowex(void)
static
const
struct
message
destroy_window_with_children
[]
=
{
{
HCBT_DESTROYWND
,
hook
|
lparam
,
0
,
WND_PARENT_ID
},
/* parent */
{
HCBT_DESTROYWND
,
hook
|
lparam
,
0
,
WND_POPUP_ID
},
/* popup */
{
EVENT_OBJECT_DESTROY
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
/* popup */
{
WM_DESTROY
,
sent
|
wparam
|
lparam
,
0
,
WND_POPUP_ID
},
/* popup */
{
WM_NCDESTROY
,
sent
|
wparam
|
lparam
,
0
,
WND_POPUP_ID
},
/* popup */
{
EVENT_OBJECT_DESTROY
,
winevent_hook
|
wparam
|
lparam
,
0
,
0
},
/* parent */
{
WM_DESTROY
,
sent
|
wparam
|
lparam
,
0
,
WND_PARENT_ID
},
/* parent */
{
WM_DESTROY
,
sent
|
wparam
|
lparam
,
0
,
WND_CHILD_ID
+
2
},
/* child2 */
{
WM_DESTROY
,
sent
|
wparam
|
lparam
,
0
,
WND_CHILD_ID
+
1
},
/* child1 */
...
...
dlls/user/tests/resource.rc
View file @
60008637
...
...
@@ -33,6 +33,8 @@
78, 1001, ASCII /* 'N' */
110, 1002, ASCII /* 'n' */
78, 1003, VIRTKEY, ALT /* Alt+'N' */
78, 1004, VIRTKEY, CONTROL, SHIFT /* Ctrl+Shift+'N' */
78, 1005, VIRTKEY, CONTROL, ALT, SHIFT /* Ctrl+Alt+Shift+'N' */
}
STRINGTABLE
...
...
@@ -64,7 +66,7 @@ CLASS_TEST_DIALOG DIALOG DISCARDABLE 0, 0, 91, 28
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "CreateDialogParams Test"
CLASS "TestDialog"
FONT 8, "
System
"
FONT 8, "
MS Shell Dlg
"
{
}
...
...
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