On 03/30/2010 03:36 AM, Tom Roche wrote:
[...]
> http://www.daa.com.au/pipermail/pygtk/2009-April/016972.html
>> Is it possible to install a global keyboard shortcut, so if the user
>> presses Ctrl-Alt-X anywhere, and my pygtk application is running, my
>> application would get an event?
Yes, that's exactly what python-keybinder does.
> but no replies to it. Can anyone show/tell me how to handle hotkeys in
> PyGTK?
import keybinder
def callback():
pass #TODO
keybinder.bind('<Alt>X', callback)
print keybinder.bind.__doc__
>> bind (keystring, callback, user_data) -> bool
>>
>> Return True on success.
>> Will raise KeyError if keystring is already bound.
Joe
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/