From e55822758e06db8a7dc5605de2dfa988f0d7d30a Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sun, 29 Dec 2024 10:49:15 +0900 Subject: [PATCH] Fix issue #2592: ALT-F4 opens Tools menu instead of exit from WinMerge --- Src/MenuBar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Src/MenuBar.cpp b/Src/MenuBar.cpp index 0ee2b2568a2..7699a844d50 100644 --- a/Src/MenuBar.cpp +++ b/Src/MenuBar.cpp @@ -398,7 +398,9 @@ BOOL CMenuBar::PreTranslateMessage(MSG* pMsg) return TRUE; } UINT uId = 0; - if ((pMsg->message == WM_SYSKEYDOWN) && GetToolBarCtrl().MapAccelerator(static_cast(pMsg->wParam), &uId) != 0) + const TCHAR key = static_cast(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);