Another problem with Enter key

Hi all,

Thank you for the previous reply, all works fine.

Python 2.3, wxPython 2.4.2.4

My new problem is the next :

wx.EVT_CHAR(tmp, self.EvtChar)

def EvtChar(self, evt) :
if evt.GetKeyCode() == wx.WXK_RETURN and \
self.Champs.IsSingleLine() :
evt.m_keyCode = wx.WXK_TAB
if evt.GetKeyCode() == wx.WXK_TAB :
control of the field and many other thing .....

The goal is the <Enter> key works like the <Tab> key.
This code works fine under Windows, but doesn't work under Linux (Mandrake 9.2).

Friendly.

···

--

Hugues JEAN-BAPTISTE (hjb@agorinfo.fr)
AGORINFO S.A.
1330 route de Neufchâtel
F-76230 QUINCAMPOIX
Tél : +33 (0) 2.32.80.87.87
Fax : +33 (0) 2.32.80.87.88
Site : http://www.agorinfo.fr
S.A. au capital de 40.000 €

Hugues JEAN-BAPTISTE wrote:

Hi all,

Thank you for the previous reply, all works fine.

Python 2.3, wxPython 2.4.2.4

My new problem is the next :

wx.EVT_CHAR(tmp, self.EvtChar)

def EvtChar(self, evt) :
if evt.GetKeyCode() == wx.WXK_RETURN and \
self.Champs.IsSingleLine() :
evt.m_keyCode = wx.WXK_TAB
if evt.GetKeyCode() == wx.WXK_TAB :
control of the field and many other thing .....

The goal is the <Enter> key works like the <Tab> key.
This code works fine under Windows, but doesn't work under Linux (Mandrake 9.2).

The proper way to get the enter to act like a tab is to send a wx.NavigationKeyEvent in response to it. In 2.5 there is a function to help you do it called Navigate, but in 2.4 you'll have to create and send the event yourself.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!