how do I create a program in windows that can be activated by pressing short cut key instead of clicking?

StackOverflow https://stackoverflow.com/questions/19316159

Question

I need to create a GUI working on windows that can be activated by pressing short cuts. 1. is it possible without setup class? 2. if not possible, just achieve pressing hotkeys and activate my program--how should i code it out--would be enough

thanks (I am using Qt for vs2012 add in to do the GUI)

Was it helpful?

Solution

I put some code up that starts a thread that does this. It is windows specific, but it does the job.

Clipboard Shortcut/Hotkey binding with Qt outside of application

One alternative to all of this, is to go to a shortcut to your program, go to its Properties, and then click on the shortcut area and type your desired shortcut. As long as it doesn't overlap with existing hotkeys that are registered in windows, it should work, without a hidden presence of your app in the system tray or some other background thread.

Hope that helps.

OTHER TIPS

libqxt offers a QxtGlobalShortcut class that does what you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top