Global keyboard shortcuts w/ Xlib



I have a small app for which I would like to create a global keyboard shortcut. What I mean by that is I want to make it so that when I press a key combination, CTRL+ALT+F12 for example, I want my application to appear on screen and have focus. I want to be able to perform this shortcut from anywhere, regarless of which application is actively focused at the time.

For those who know the Windows API, I'm looking for something like the RegisterHotkey function.

I heard I need to use the XLib to be able to watch the key events, but I'm not sure how to go about this. I managed to get the XGrabKey function to execute without any problems, but after that I'm not sure how to monitor the key-press events in order to catch the shortcut. Maybe I'm going about this all wrong though and XGrabKey isn't what I need.

Thanks for any help,

--
Keith Maika
http://kicken.mine.nu:8008/  - Personal Site.
http://wiser.kicks-ass.org:8008/  - Long-term Project.
http://www.fsf.org/philosophy/can-you-trust.html - Can you trust your computer? http://www.fsf.org/philosophy/no-word-attachments.html - Support Free Communication.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]