From: Bruce S. <Bru...@nc...> - 2012-11-15 20:36:07
|
For keyboard input, I translate keycode numbers from a US keyboard into strings, so that pressing the Enter key returns the string "enter". If there is someone in the VPython community knowledgeable about non-US keyboards and would like to contribute alternative translation tables, I'd be delighted to make them accessible in the new VPython. Take a look at the GitHub file site-packages/visual_common/create_display.py which contains the US keyboard translation table. Probably the keyboard table should be imported from a file "keyboard-us.py", and similarly for other tables. We could add to the site-settings.py file options to specify what keyboard layout to use by default, and now that we'll have pull-down menus we can give the end user a choice (or maybe there's a way to detect the keyboard?). One of the goals of vpython-wx is to make it a lot easier for people to contribute to its further development. The old VPython depended on a lot of multithreaded C++ code, but the new version has eliminated the threading, which makes many things a whole lot simpler (and you don't have to worry about a lot of now nonexistent potential threading problems), and the new version has much of the key user interface stuff written in Python. Bruce Sherwood |