KiCad PCB EDA Suite
WX_MENUBAR Class Reference

Wrapper around a wxMenuBar object that prevents the accelerator table from being used. More...

#include <wx_menubar.h>

Inheritance diagram for WX_MENUBAR:

Public Member Functions

void SetAcceleratorTable (const wxAcceleratorTable &aTable) override
 

Detailed Description

Wrapper around a wxMenuBar object that prevents the accelerator table from being used.

It appears that on MSW the accelerator table of a wxMenuBar will be searched before key events are passed to other items. This means key events matching hotkey combinations are converted to menu events and never get passed to text controls. To work around this, simply don't let the menubar have an accelerator table. See https://gitlab.com/kicad/code/kicad/-/issues/1941

Note that on OSX, menus also steal the key events from text controls, but that is done by OSX itself, so other workarounds are included inside ACTION_MENU::OnMenuEvent() and TOOL_DISPATCHER::DispatchWxEvent() to redirect key presses to text-based controls when they have focus.

Definition at line 45 of file wx_menubar.h.

Member Function Documentation

◆ SetAcceleratorTable()

void WX_MENUBAR::SetAcceleratorTable ( const wxAcceleratorTable &  aTable)
inlineoverride

Definition at line 51 of file wx_menubar.h.

52  {
53  // Don't use the passed in accelerator table, create a new empty one
54  wxMenuBar::SetAcceleratorTable( wxAcceleratorTable() );
55  }

The documentation for this class was generated from the following file: