Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » New functions to SysInfo
Re: New functions to SysInfo [message #21205 is a reply to message #21204] Sat, 09 May 2009 16:42 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3361
Registered: August 2008
Senior Veteran
Hello tojocky

If that is your situation
koldo wrote on Sat, 09 May 2009 15:15

I think I understand you: when your program is running although hidden in the tray you want to open it by clicking some keys like the Ctrl+Ctrl used for Google Desktop, isn't it?


you can do this in Windows:

To monitor keys, for example left Control key, you have to call GetKeyState().

This function answers you if the key is pressed and if it is toggled (this serves too for keys that are not the Caps-Lock!).

A sample:

	char k = GetKeyState(VK_LCONTROL);
	if (k & 1)
		puts("Toggled");
	if (k & 128)
		puts("Pressed");

This works although your program is not focused, and does not affect to the normal keyboard use, I mean, you will not steal keys to anybody.

When your program is in the tray you can enter it in a loop that checks every 100 ms the Ctrl toggle state. If you detects toggle two times in less than 200 ms, voilá!

Best regards
Koldo




Best regards
Iñaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Read Message
Read Message
Previous Topic: How to get/set keyboard layout in u++
Next Topic: TabBar translation file
Goto Forum:
  


Current Time: Tue May 14 21:26:31 CEST 2024

Total time taken to generate the page: 0.02329 seconds