Global keyboard event handler

Is it possible to create a top level (global) keyboard handler? I want to have my application handle hotkeys like CTRL-S (save) and CTRL-O (open), etc, and I want to be able to detect and handle these events no matter which widget has focus. I don’t want to have to add a key event handler to every control that might have focus.

Try an accelerator table. See this blog entry.

If you need more customization, you can use wx.EVT_CHAR_HOOK for your window.

1 Like