KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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
 
wxString GetMenuLabelText (size_t aPos) const 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 46 of file wx_menubar.h.

Member Function Documentation

◆ GetMenuLabelText()

wxString WX_MENUBAR::GetMenuLabelText ( size_t  aPos) const
inlineoverride

Definition at line 58 of file wx_menubar.h.

◆ SetAcceleratorTable()

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

Definition at line 52 of file wx_menubar.h.


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