views:

89

answers:

1

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 ?

+1  A: 

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

Steven Sproat