The key "Enter" does not trigger key down

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.Bind(wx.EVT_KEY_DOWN, self._OnKeyDown)

c.Bind(wx.EVT_KEY_UP, self._OnKeyUp)

Bruce Sherwood wrote:

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)

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

Okay, I’ll try that, but I can’t think of how Windows would use Enter for navigation. Thanks.

···

On Mon, Apr 29, 2013 at 10:04 PM, Robin Dunn robin@alldunn.com wrote:

Bruce Sherwood wrote:

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)

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

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.

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
···

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.

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.

···

On 30 April 2013 15:37, Mike Driscoll kyosohma@gmail.com wrote:

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

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-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.