I’m trying to build a wx.KeyEvent for unit testing. I need to set the UnicodeKeyCode property but can’t. I can see the property but it won’t let me set it. The only reason I tried to set it was the method SetUnicodeKeyCode doesn’t seem to exist, even though the documentation says it does. So what’s up with that? Another oddity: in the documentation the constructor shows an argument keyEventType, but when I try keyEventType=wx.EVT_CHAR I get told there’s no such parameter. It does seem to like wx.EventKey(wx.EVT_CHAR.typeId). I’m at a loss here.
in my documentation the property ‘UnicodeKey’ of the object wx.KeyEvent only refers to ‘GetUnicodeKey’, i.e. only read access (this is possible even in python!) and the ‘SetUnicodeKey’ method doesn’t exist… so what is odd about that?
You’re probably looking at the dev version of the documentation, rather than the docs for the released version. The released version of the docs are at http://docs.wxpython.org/
The setter methods for the
wx.KeyEvent public attributes have already been added for the 4.1 release, so that’s why they shows up in the dev docs.
Aha. I just Googled for wxpython wx.KeyEvent and didn’t notice the Phoenix bit. Sigh. Sure would like to set that key code.