Register Hotkey on Linux

> Lucas Boppre Niehues wrote:
>
>> Oh noes.
>>
>> Is there anything else to do? Or are the multiples linux's desktop
>> environments standards too much for python?
>>
>> Or is there any way to *simulate* a hotkey? I can set some command -
>> hotkey pairs, but they would re-run the application every time, making it
>> slowish.
>>
>
> Why not use an Accelerator Table? Just be sure to include a menubar (which
> can be hidden if you like) as there's a bug in 2.8.9.1 that requires it for
> the AcceleratorTable to work.
>
> Mike
> _______________________________________________
> wxpython-users mailing list
> wxpython-users@lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
Will it function *globally*? It's for an application launcher, I have to be
able to press the keystroke even when watching a full-screen movie with no
focus whatsoever over the python application.
  ___

I doubt it. Doing a little Googling, I found this C program: http://jaredforsyth.com/content/linux-global-hotkeys

It uses xlib, which Python has wrappers for, so you should be able to port it to Python: http://python-xlib.sourceforge.net/

Whatever you use, it will need to hook into the OS's window system to do this and probably run as some kind of background process.

Mike

ยทยทยท

On Thu, Feb 12, 2009 at 8:25 PM, Mike Driscoll <mike@pythonlibrary.org>wrote: