This is a small handler for EVT_KEY_DOWN:
def OnKeyDown(self, event):
char = event.GetKeyCode()
print str(char)
I used it in a class that extends wxStyledTextCtrl.
Well, it looks like there is some bug somewhere.
The handler, under windows, says that } has code 221, _ has code 339 (???)
and other amenities; under linux it works as it is supposed to work.
I guess the bug is in wxWindows but maybe it is triggered only in local
versions of win98 since I found no reference to it. Could you try
the code and check to see if there is something wrong with me or with key
codes?
Thanks,
Davide.
Well, it looks like there is some bug somewhere.
The handler, under windows, says that } has code 221, _ has code 339 (???)
and other amenities; under linux it works as it is supposed to work.
I guess the bug is in wxWindows but maybe it is triggered only in local
versions of win98 since I found no reference to it. Could you try
the code and check to see if there is something wrong with me or with key
codes?
On windows, the key that has '{' on it for the US is an OEM key and can
be redefined for other countries so its a little strange. The platform SDK
defines:
#define VK_OEM_6 0xDD // ']}' for US
German keyboards use this key code for "ü" (u with umlaut if my mailer
wrecks this message) and French keyboards define this as an acute prefix to
be combined with the next character if possible. Its generally non-portable
to try to map this key as an accelerator.
Windows has both low level key events and if these are sent through
default processing they become higher level WM_CHAR events if they are
normal printable characters.
Scintilla has changed behaviour here recently which may cause trouble
when the changes are integrated into wxSTC. Previously, Scintilla use
platform dependent key codes. Now it uses a set of its own cross platform
definitions and converts to these before further processing. The wxSTC
binding may need to convert both to these codes when handing key events to
Scintilla and from these codes when receiving key codes or invoking key
definition APIs.
Neil