wxPython: Transferring keyboard events from one frame to another

Ziv Forshtat forshtat at hotmail.com
Mon Feb 2 12:35:43 EST 2004


Hi All,
I'm in the process of implementing a virtual keypad: I have a wxFrame
which contains a photo the keypad of some device, and I'm using it to
enter special keywords into an editor window (wxStc). Each part of the
photo is associated with a certain keyword, which is sent to the
editor frame and displayed inside the editor. This is working fine.
However, if I want a proper virtual keyboard I should also be able to
transfer the regular keypresses (keyboard events) from my virtual
keypad frame to the editor frame, in order to save the user the
trouble of clicking on the editor window every time in order to set
the focus.

I tried using wxPostEvent to transfer the KEY_DOWN event from the
keypad frame to the appropriate control in the editor frame. The
problem is that the event which I am posting is only caught if I
override the KEY_DOWN event. It does not find its way to the default
event handler of this event.

I have read that there are some problems with wxPostEvent in this
context, but was wondering if someone has found a workaround for this
issue, as this would be the simplest solution for my problem. Other
ideas are also welcome...

BTW, I'm working on MSW. 

Thanks,
       Ziv



More information about the Python-list mailing list