Reputation: 6160
I have two wxListCtrl and want to process the Ctrl+Enter keyboard event without letting wx change the focus to the other ListCtrl.
I have event handlers for wx.EVT_KEY_DOWN, wx.EVT_KEY_UP, wx.EVT_CHAR and KillFocus, but KillFocus is always called first, then the focus changes and the the keyboard handlers are called for the wrong ListCtrl.
Is there a way to prevent wx from changing the focus, when Ctrl+Enter is pressed ?
Upvotes: 1
Views: 319
Reputation: 4578
No idea if this will work, but who knows!
ac = [(wx.ACCEL_CTRL, wx.WXK_RETURN, wx.NewId())]
tbl = wx.AcceleratorTable(ac)
list.SetAcceleratorTable(tbl) # should overwrite its bindings?
or also try EVT_CHAR_HOOK
Upvotes: 1