Keyboard Events

Mike Driscoll kyosohma at gmail.com
Mon May 26 17:18:16 EDT 2008


On May 26, 2:06 pm, Gandalf <goldn... at gmail.com> wrote:
> I use WX on windows XP and I try to generate an event when the user is
> clicking the keyboard while the application frame is not in focus.
> All I manged to do were while the application frame is in focus
> Can someone please show me how to do it?
>
> Thanks !

You can only catch the keyboard events for whichever widget is in
focus. So, if you have a text control, you'll need to bind to that.
The events you're likely need are EVT_KEYDOWN or EVT_CHAR. You cannot
catch keyboard events with wx if you are using MS Word. For that sort
of thing,you'll have to hook in at the OS level.

Mike



More information about the Python-list mailing list