PDA

View Full Version : Input to inactive application



mvbhavsar
16th June 2012, 18:56
Hi,

I have my application minimized in system tray and focus is not on that application.
I want to pass some string when particular key is pressed.
Key press is handled in my application but is not able to get notification in my application during inactive state once key is pressed.
Please help me out.

Regards

Manish

ObiWanKenobe
16th June 2012, 19:55
If you develop for Windows, you can implement a keyboard hook, which calls a specific function of your choice.
The hook is a callback function and must be implemented in a DLL.
This link explains how:
http://www.codeproject.com/Articles/1264/KeyBoard-Hooks

mvbhavsar
17th June 2012, 07:43
Thanks ObiWanKenobe.

Let me give a try on this.


Regards

Manish

Ali Reza
17th June 2012, 11:04
you can use the windows API function: getAsyncKeyState() in windows.h header.
and you also use QKeyEvent class.