win32 keyboard

Today 12:35:02
  
I chose wxpython because everyone touted cross platform.

I spent a month developing this app on Kubuntu. Looks great,
lots of use of function keys, navigates a ListCtrl.
Copied it to WinXP, loaded latest wxpython and Python25.
Screen colors look strange, spacing is off, but worst:

no response to function keys or enter key events.
and tab just puts a funny char in the textctrl.

Should I be doing something different for win32 keyboard?

All below works great on Kubuntu but not WinXP.

def payframe(s):
s.f = payf.PAYF(None, -1)
s.f.Bind(wx.EVT_KEY_DOWN,s.processkey)
s.f.Bind(wx.EVT_TEXT_ENTER,s.procenter)

def processkey(s,event):
k = event.GetKeyCode()
print k
wx.WXK_PAGEDOWN = 313 # wierd that I should have to
wx.WXK_PAGEUP = 312 # do this wx constants broken
if k == wx.WXK_TAB: s.dotab(); return
if k == wx.WXK_ESCAPE: s.escexit(0); return
if k == wx.WXK_F1: s.f1accept(0); return
if k == wx.WXK_F2: s.f2move(0); return
if k == wx.WXK_DOWN: s.downup('d'); return
if k == wx.WXK_UP : s.downup('u') ; return
# if k == wx.WXK_PAGEDOWN : s.pagedown() ; return

Phillip Watts wrote:

Today 12:35:02
   I chose wxpython because everyone touted cross platform.

I spent a month developing this app on Kubuntu. Looks great,
lots of use of function keys, navigates a ListCtrl.
Copied it to WinXP, loaded latest wxpython and Python25.
Screen colors look strange, spacing is off, but worst:

no response to function keys or enter key events.
and tab just puts a funny char in the textctrl.

Should I be doing something different for win32 keyboard?

All below works great on Kubuntu but not WinXP.

  def payframe(s):
        s.f = payf.PAYF(None, -1)
        s.f.Bind(wx.EVT_KEY_DOWN,s.processkey)
        s.f.Bind(wx.EVT_TEXT_ENTER,s.procenter)

Is payf.PAYF a class derived from wx.Frame? If so then that is your problem. The EVT_KEY_DOWN event is only sent from widgets that have the keyboard focus, and frames can not have the focus. What kind of content is in the frame? If there are child widgets then that is where the focus will be.

···

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