PDA

View Full Version : Capture key & key combinations from keyboard



aikidorb
5th June 2010, 13:30
Let's say I have a window-less application which has only an icon on the Taskbar (Windows, Mac OS X & Linux). I want it to capture some key & key combinations, let's say Right Control + Right Shift. Upon keying in correct, combination, it will do something, say take screenshot. I can do window-less app, icon on the Taskbar and screen capture but I don't know how to monitor keyboard globally for key combinations. Please kindly advise. Any help or hint is greatly appreciated! Thanks in advance!

numbat
5th June 2010, 13:56
I don't think there is anything in Qt to do this but have a look at hotkey.cpp (http://code.google.com/p/kludgets/source/browse/trunk/hotkey.cpp?spec=svn73&r=57). There are implementations for Windows and Linux in the drop down list of files.

tbscope
5th June 2010, 14:03
Or, use this:
http://doc.libqxt.org/0.6.0/qxtglobalshortcut.html

aikidorb
5th June 2010, 14:13
Thank you very much numbat & tbscope. Your prompt responses are very appreciated. Let me have a look at the pointers.