The key "Enter" does not trigger key down

89 views
Skip to first unread message

Bruce Sherwood

unread,
Apr 28, 2013, 11:18:36 PM4/28/13
to wxpytho...@googlegroups.com
Below is an extract from my code, which works with 64-bit Python 2.7 and wxPython 2.9.4 on Windows. With 64-bit Python 3.2 and wxPython Phoenix 2.9.5.81 downloaded this evening, the code still works except for "Enter", which does not trigger EVT_KEY_DOWN. The key down event for "Enter" seems to be lost.

        c = self._canvas = wx.glcanvas.GLCanvas(parent, -1, pos=(x, y), size=(w, h))
        self._context = wx.glcanvas.GLContext(c)
        c.Bind(wx.EVT_KEY_DOWN, self._OnKeyDown)
        c.Bind(wx.EVT_KEY_UP, self._OnKeyUp)

Robin Dunn

unread,
Apr 30, 2013, 12:04:37 AM4/30/13
to wxpytho...@googlegroups.com
Try using the wx.WANTS_CHARS style. That will help get key/char events
for keys that are normally used for navigation on Windows.


--
Robin Dunn
Software Craftsman
http://wxPython.org

Bruce Sherwood

unread,
Apr 30, 2013, 12:13:36 AM4/30/13
to wxpytho...@googlegroups.com
Okay, I'll try that, but I can't think of how Windows would use Enter for navigation. Thanks.




--
You received this message because you are subscribed to a topic in the Google Groups "wxPython-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/eH8mRSB_1sg/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Mike Driscoll

unread,
Apr 30, 2013, 10:37:19 AM4/30/13
to wxpytho...@googlegroups.com


On Monday, April 29, 2013 11:13:36 PM UTC-5, Bruce Sherwood wrote:
Okay, I'll try that, but I can't think of how Windows would use Enter for navigation. Thanks.


If you press enter on a form in wx, the cursor will typically jump from one text field to the next, much like tabbing between fields does. You can also press enter when a button has focus to press the button.

- Mike

Valdemar Domingos

unread,
Apr 30, 2013, 11:31:23 AM4/30/13
to wxpytho...@googlegroups.com
Hi

I don't know if this will help, but I had also this problem and in my case it was because I had my wx.TextCtrl inside a panel, and this panel had a border, any border. I don't know why this caused this problem. Once I identified the cause of the problem, I removed the border and my wx.TextCtrl works fine after that. 




--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages