[wxPython] wxKeyEvent::GetKeyCode() returns capital letter code even when no shift/capslock

Hi all, trying to get a wxPython version of OpenGLContext working, and ran
into this problem. Events are hooked on a wxGLCanvas-derived class using

  EVT_KEY_DOWN( self, self.wxOnKeyDown )
  EVT_KEY_UP( self, self.wxOnKeyUp )

these just call getKeyID to get the key value, it always returns the UC
versions.

  def getKeyID( self, keyEvent ):
    '''Get the KeyID for the event'''
    print 'keycode is',keyEvent.GetKeyCode()
    result = keyboardMapping.get( keyEvent.GetKeyCode())
    return result

Suggestions?

Enjoy,
Mike

Hi all, trying to get a wxPython version of OpenGLContext working, and ran
into this problem. Events are hooked on a wxGLCanvas-derived class using

EVT_KEY_DOWN( self, self.wxOnKeyDown )
EVT_KEY_UP( self, self.wxOnKeyUp )

these just call getKeyID to get the key value, it always returns the UC
versions.

EVT_KEY_UP and EVT_KEY_DOWN are called for the raw key events. EVT_CHAR is
the event for the cooked keystrokes. If you need to do EVT_KEY_UP and
EVT_KEY_DOWN then you need to check shift states yourself.

···

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