[pygtk] hotkey support?
Johannes Mockenhaupt
johannes.mockenhaupt at gmx.de
Wed Mar 31 04:16:25 WST 2010
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
More information about the pygtk
mailing list