From: John L. <jla...@gm...> - 2012-06-21 17:48:21
|
On Thu, Jun 21, 2012 at 8:12 AM, Andre Arpin <ar...@ki...> wrote: > -- Could this be tried on unix > -- Type an 'a'. Enable caps lock and type another 'a' > -- is the keycode 65 in both cases. > -- Note: There does not seem to be any way to find out if 'a' is capitalize. > -- You get a transition code for caps but you do not know > -- if its going up or down. > > frame = wx.wxFrame( wx.NULL, wx.wxID_ANY, "Testing") > > frame:Connect(wx.wxID_ANY, wx.wxEVT_CHAR_HOOK, > function(event) > print(event.KeyCode) > end) > > frame:Show() This is normal, use wxEVT_CHAR to get the translated key. http://docs.wxwidgets.org/trunk/classwx_key_event.html "To summarize: you should handle wxEVT_CHAR if you need the translated key and wxEVT_KEY_DOWN if you only need the value of the key itself, independent of the current keyboard state." Regards, John |