If someone could show me what I'm doing wrong here, I'd be very grateful. The Demo keyboard events program runs fine. Here's my code snippet:
class MyPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1,
wx.DefaultPosition,
wx.DefaultSize,
wx.WANTS_CHARS |
wx.FULL_REPAINT_ON_RESIZE
)
self.Bind(wx.EVT_CHAR, self.OnTestEvent)
self.Bind(wx.EVT_KEY_DOWN, self.OnTestEvent)
self.Bind(wx.EVT_KEY_UP, self.OnTestEvent)
def OnTestEvent(self, event):
print "Event:", event
event.Skip()
This is all embedded in a wx.Frame. The 'OnTestEvent routine just never gets called. The only difference with the demo that I can see is that it uses a wx.Window instead of a wx.Panel. I've also tried the same on the wx.Frame.
Thanks for any help,
Michael