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
86e4079b
Commit
86e4079b
authored
Nov 26, 2003
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 26, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Alt+[national key] menu shortcuts work.
parent
358fff81
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
menu.c
controls/menu.c
+8
-6
controls.h
dlls/user/controls.h
+1
-1
defwnd.c
windows/defwnd.c
+15
-5
nonclient.c
windows/nonclient.c
+1
-1
No files found.
controls/menu.c
View file @
86e4079b
...
...
@@ -664,7 +664,7 @@ static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu,
* Return item id, -1 if none, -2 if we should close the menu.
*/
static
UINT
MENU_FindItemByKey
(
HWND
hwndOwner
,
HMENU
hmenu
,
UINT
key
,
BOOL
forceMenuChar
)
WCHAR
key
,
BOOL
forceMenuChar
)
{
TRACE
(
"
\t
looking for '%c' (0x%02x) in [%p]
\n
"
,
(
char
)
key
,
key
,
hmenu
);
...
...
@@ -3000,12 +3000,14 @@ void MENU_TrackMouseMenuBar( HWND hWnd, INT ht, POINT pt )
*
* Menu-bar tracking upon a keyboard event. Called from NC_HandleSysCommand().
*/
void
MENU_TrackKbdMenuBar
(
HWND
hwnd
,
UINT
wParam
,
INT
vkey
)
void
MENU_TrackKbdMenuBar
(
HWND
hwnd
,
UINT
wParam
,
WCHAR
wChar
)
{
UINT
uItem
=
NO_SELECTED_ITEM
;
HMENU
hTrackMenu
;
UINT
wFlags
=
TPM_ENTERIDLEEX
|
TPM_LEFTALIGN
|
TPM_LEFTBUTTON
;
TRACE
(
"hwnd %p wParam 0x%04x wChar 0x%04x
\n
"
,
hwnd
,
wParam
,
wChar
);
/* find window that has a menu */
while
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_CHILD
)
...
...
@@ -3014,7 +3016,7 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey)
/* check if we have to track a system menu */
hTrackMenu
=
GetMenu
(
hwnd
);
if
(
!
hTrackMenu
||
IsIconic
(
hwnd
)
||
vkey
==
VK_SPACE
)
if
(
!
hTrackMenu
||
IsIconic
(
hwnd
)
||
wChar
==
' '
)
{
if
(
!
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_SYSMENU
))
return
;
if
(
GetWindowLongW
(
hwnd
,
GWL_EXSTYLE
)
&
WS_EX_MANAGED
)
return
;
...
...
@@ -3027,9 +3029,9 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey)
MENU_InitTracking
(
hwnd
,
hTrackMenu
,
FALSE
,
wFlags
);
if
(
vkey
&&
vkey
!=
VK_SPACE
)
if
(
wChar
&&
wChar
!=
' '
)
{
uItem
=
MENU_FindItemByKey
(
hwnd
,
hTrackMenu
,
vkey
,
(
wParam
&
HTSYSMENU
)
);
uItem
=
MENU_FindItemByKey
(
hwnd
,
hTrackMenu
,
wChar
,
(
wParam
&
HTSYSMENU
)
);
if
(
uItem
>=
(
UINT
)(
-
2
)
)
{
if
(
uItem
==
(
UINT
)(
-
1
)
)
MessageBeep
(
0
);
...
...
@@ -3043,7 +3045,7 @@ void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey)
if
(
uItem
==
NO_SELECTED_ITEM
)
MENU_MoveSelection
(
hwnd
,
hTrackMenu
,
ITEM_NEXT
);
else
if
(
vkey
)
else
if
(
wChar
)
PostMessageW
(
hwnd
,
WM_KEYDOWN
,
VK_DOWN
,
0L
);
MENU_TrackMenu
(
hTrackMenu
,
wFlags
,
0
,
0
,
hwnd
,
NULL
);
...
...
dlls/user/controls.h
View file @
86e4079b
...
...
@@ -59,7 +59,7 @@ extern HMENU MENU_GetSysMenu(HWND hWndOwner, HMENU hSysPopup);
extern
UINT
MENU_GetMenuBarHeight
(
HWND
hwnd
,
UINT
menubarWidth
,
INT
orgX
,
INT
orgY
);
extern
void
MENU_TrackMouseMenuBar
(
HWND
hwnd
,
INT
ht
,
POINT
pt
);
extern
void
MENU_TrackKbdMenuBar
(
HWND
hwnd
,
UINT
wParam
,
INT
vkey
);
extern
void
MENU_TrackKbdMenuBar
(
HWND
hwnd
,
UINT
wParam
,
WCHAR
wChar
);
extern
UINT
MENU_DrawMenuBar
(
HDC
hDC
,
LPRECT
lprect
,
HWND
hwnd
,
BOOL
suppress_draw
);
extern
UINT
MENU_FindSubMenu
(
HMENU
*
hmenu
,
HMENU
hSubTarget
);
...
...
windows/defwnd.c
View file @
86e4079b
...
...
@@ -559,7 +559,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
iF10Key
=
1
;
else
if
(
wParam
==
VK_ESCAPE
&&
(
GetKeyState
(
VK_SHIFT
)
&
0x8000
))
SendMessageW
(
hwnd
,
WM_SYSCOMMAND
,
SC_KEYMENU
,
VK_SPACE
);
SendMessageW
(
hwnd
,
WM_SYSCOMMAND
,
SC_KEYMENU
,
' '
);
break
;
case
WM_KEYUP
:
...
...
@@ -572,23 +572,25 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
break
;
case
WM_SYSCHAR
:
{
iMenuSysKey
=
0
;
if
(
wParam
==
VK_RETURN
&&
IsIconic
(
hwnd
))
if
(
wParam
==
'\r'
&&
IsIconic
(
hwnd
))
{
PostMessageW
(
hwnd
,
WM_SYSCOMMAND
,
SC_RESTORE
,
0L
);
break
;
}
if
((
HIWORD
(
lParam
)
&
KEYDATA_ALT
)
&&
wParam
)
{
if
(
wParam
==
VK_TAB
||
wParam
==
VK_ESCAPE
)
break
;
if
(
wParam
==
VK_SPACE
&&
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_CHILD
))
if
(
wParam
==
'\t'
||
wParam
==
'\x1b'
)
break
;
if
(
wParam
==
' '
&&
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_CHILD
))
SendMessageW
(
GetParent
(
hwnd
),
msg
,
wParam
,
lParam
);
else
SendMessageW
(
hwnd
,
WM_SYSCOMMAND
,
SC_KEYMENU
,
wParam
);
}
else
/* check for Ctrl-Esc */
if
(
wParam
!=
VK_ESCAPE
)
MessageBeep
(
0
);
if
(
wParam
!=
'\x1b'
)
MessageBeep
(
0
);
break
;
}
case
WM_SHOWWINDOW
:
{
...
...
@@ -867,6 +869,14 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
result
=
0
;
break
;
case
WM_SYSCHAR
:
{
BYTE
ch
=
LOWORD
(
wParam
);
WCHAR
wch
;
MultiByteToWideChar
(
CP_ACP
,
0
,
&
ch
,
1
,
&
wch
,
1
);
wParam
=
MAKEWPARAM
(
wch
,
HIWORD
(
wParam
)
);
}
/* fall through */
default:
result
=
DEFWND_DefWinProc
(
hwnd
,
msg
,
wParam
,
lParam
);
break
;
...
...
windows/nonclient.c
View file @
86e4079b
...
...
@@ -2193,7 +2193,7 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
break
;
case
SC_KEYMENU
:
MENU_TrackKbdMenuBar
(
hwnd
,
wParam
,
LOWORD
(
lParam
)
);
MENU_TrackKbdMenuBar
(
hwnd
,
wParam
,
(
WCHAR
)
lParam
);
break
;
case
SC_TASKLIST
:
...
...
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