I have a main window that I’d like to have intercept all keyboard input, and then Skip() on if it doesn’t have a given key combination registered. I tried using:
self.Bind(wx.EVT_KEY_DOWN, self.OnChar)
I also tried:
wx.EVT_CHAR(self, self.OnChar)
but that didn’t capture any keypresses (apparently because a frame can’t receive keyboard input). Then I tried
where panel was an arbitrarily attached wx.Panel that was made to receive focus when the window was created. This worked, sort of - so long as no child widget got focus, everything proceeded as expected (for now, self.OnChar() is just a simple handler to tell me what keys were pressed). So, the question: Is there any way to create a set of hotkeys that works for an entire window, whether the panel or another child control has the focus, that can capture certain hotkeys that are registered with it and pass others on to the child controls (I should add that I’m working in Linux, but am making an app that should be cross-platform)? This was pretty straightforward in pygtk.
I have a main window that I'd like to have intercept all keyboard input, and then Skip() on if it doesn't have a given key combination registered. I tried using:
self.Bind(wx.EVT_KEY_DOWN, self.OnChar)
I also tried:
wx.EVT_CHAR(self, self.OnChar)
but that didn't capture any keypresses (apparently because a frame can't receive keyboard input). Then I tried
where panel was an arbitrarily attached wx.Panel that was made to receive focus when the window was created. This worked, sort of - so long as no child widget got focus, everything proceeded as expected (for now, self.OnChar() is just a simple handler to tell me what keys were pressed). So, the question: Is there any way to create a set of hotkeys that works for an entire window, whether the panel or another child control has the focus, that can capture certain hotkeys that are registered with it and pass others on to the child controls (I should add that I'm working in Linux, but am making an app that should be cross-platform)? This was pretty straightforward in pygtk.