Skip to content

Commit

Permalink
Fix issue WinMerge#2592: ALT-F4 opens Tools menu instead of exit from…
Browse files Browse the repository at this point in the history
… WinMerge
  • Loading branch information
sdottaka committed Dec 29, 2024
1 parent ceb6311 commit e558227
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Src/MenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,9 @@ BOOL CMenuBar::PreTranslateMessage(MSG* pMsg)
return TRUE;
}
UINT uId = 0;
if ((pMsg->message == WM_SYSKEYDOWN) && GetToolBarCtrl().MapAccelerator(static_cast<TCHAR>(pMsg->wParam), &uId) != 0)
const TCHAR key = static_cast<TCHAR>(pMsg->wParam);
const bool alnum = (key >= '0' && key <= '9') || (key >= 'A' && key <= 'Z');
if ((pMsg->message == WM_SYSKEYDOWN) && alnum && GetToolBarCtrl().MapAccelerator(key, &uId) != 0)
{
ShowKeyboardCues(true);
OnMenuBarMenuItem(uId);
Expand Down

0 comments on commit e558227

Please sign in to comment.