It is probably being caught early and turned into a navigation event. If you don't need tab traversal then you can turn it off in the parent panel with style=0, or you may be able to get the return key events with EVT_CHAR_HOOK or with EVT_NAVIGATION_KEY.
···
On 1/1/12 9:12 AM, Michael Hipp wrote:
For a long time I've been using this on my panel to get access to some
keystrokes of interest:
for ctrl in self.GetChildren():
ctrl.Bind(wx.EVT_KEY_DOWN, self._on_key_down)
Since upgrading to 2.9.3.1 I no longer get an event for the
wx.WXK_RETURN key. Any idea how I can get it?
Yes, removing TAB_TRAVERSAL seems to have fixed it, and allowed me to simplify some of my custom navigation code.
FYI, the enter key was not coming thru from EVT_NAVIGATION_KEY.
Thanks,
Michael
···
On 2012-01-02 2:56 PM, Robin Dunn wrote:
On 1/1/12 9:12 AM, Michael Hipp wrote:
For a long time I've been using this on my panel to get access to some
keystrokes of interest:
for ctrl in self.GetChildren():
ctrl.Bind(wx.EVT_KEY_DOWN, self._on_key_down)
Since upgrading to 2.9.3.1 I no longer get an event for the
wx.WXK_RETURN key. Any idea how I can get it?
It is probably being caught early and turned into a navigation event. If you
don't need tab traversal then you can turn it off in the parent panel with
style=0, or you may be able to get the return key events with EVT_CHAR_HOOK or
with EVT_NAVIGATION_KEY.
I'm having a problem where I've got a selected item in an
UltimateListCtrl and am hitting Enter
and expect an Activation event, as the documentation says it should
(on double-click or Enter).
But that doesn't happen, and instead the Enter is navigating away from
the list control.
I then set up to catch navigation events on the panel, and indeed am
getting a navigation event
and event.IsFromTab() is False.
What's going on? Why is Enter "being turned into a navigation event"
as Robin mentioned?
Because the Windows APIs wx is using for automatic navigation support are doing it, if I remember correctly.
How can I keep preserve tab-traversal and not allow Enter to cause
traversal?
If it makes sense for the layout of your window you might be able to work around this by putting the ULC on a panel that is a sibling of the panel containing the rest of your widgets, and give the ULC's panel a style=0 to turn off tab traversal for it.