From 5db2b6ed8de9c933b678e540b48850c2fc78dba8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 17 Jun 2020 12:00:34 +0200 Subject: [PATCH] Action menu: ensure a wxEVT_COMMAND_MENU_SELECTED event is sent to the menu, when a wxTextCtrl has the focus but is read only, and cannot use a CHAR event. It fixes an issue in Kicad manager (menus with accelerator not working) when the wxTextCtrl window showing messages has the focus. --- common/tool/action_menu.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/tool/action_menu.cpp b/common/tool/action_menu.cpp index 7f5d35d49a..c4271bba8d 100644 --- a/common/tool/action_menu.cpp +++ b/common/tool/action_menu.cpp @@ -415,7 +415,12 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent ) focus->HandleWindowEvent( keyEvent ); } - return; + // If the event was used as KEY event (not skipped) by the focused window, + // just finish. + // Otherwise this is actually a wxEVT_COMMAND_MENU_SELECTED, or the + // focused window is read only + if( !keyEvent.GetSkipped() ) + return; } }