Tim Roberts wrote:
> The accelerator table is an app-global thing, and hence is only meaningful for wx.Frames.
This doesn't seem to be the case, at least not on Windows. To start
with, I was binding my wx.EVT_MENU handler directly on the context menu
instance, and calling SetAcceleratorTable on my ListBox. My
understanding of how wx propagates events is muddled at best, but I
assume that the events fired by the ListBox when I pressed the assigned
accelerators simply weren't reaching the menu at all. As soon as I
bound wx.EVT_MENU on the ListBox instead, the accelerator table worked
flawlessly.
Having said that, in a short sample I wrote, setting an accelerator
table for a wx.Panel and also binding wx.EVT_MENU on that panel doesn't
work either. So maybe the ListBox is a special case or there's
something else at play. Either way, for the moment, my ListBox has
specific shortcut keys which is what I was after.