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 #21219 is a reply to message #21212] Sun, 10 May 2009 08:50 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3361
Registered: August 2008
Senior Veteran
tojocky wrote on Sat, 09 May 2009 22:01

Hello Koldo!

Yes, You understand me correct!

I want to handle the shortcut key when the GoogleTranslator is running (is in tray or opened main window).

For the first I would like to handle the shortcut [Ctrl]+[C]+[C] or [Ctrl]+[Ins]+[Ins] . With this handle I can read from buffer the copied text and translate this.

If I'm wrong, please correct me.

If you can give me a simple example about this, i will be glad!


Thank you Koldo!


Hello tojocky

You can use this
CONSOLE_APP_MAIN
{
	TimeStop t;
	int t_ctrl_l, t_ctrl_r;
	
	t_ctrl_r = t_ctrl_l = 0;
	while (true) {
		char ctrl_l = (char)GetKeyState(VK_LCONTROL);
		if (ctrl_l & 128)		// Left Ctrl pressed
			t_ctrl_l = t.Elapsed();
		char ctrl_r = (char)GetKeyState(VK_RCONTROL);			
		if (ctrl_r & 128)		// Right Ctrl pressed
			t_ctrl_r = t.Elapsed();			
		if (t_ctrl_r - t_ctrl_l < 300 && t_ctrl_r - t_ctrl_l > 0) {
			puts("Voila");
			t_ctrl_r = t_ctrl_l = 0; 	
		}

		Sleep(100);
	}


This will out a "Voila" when a Ctrl left and a Ctrl right are pressed.

For a Gui application remove the while loop and the Sleep() and put this in a Timer function.

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 14:38:56 CEST 2024

Total time taken to generate the page: 0.02685 seconds