Home » Developing U++ » UppHub » New functions to SysInfo
Re: New functions to SysInfo [message #21333 is a reply to message #21219] |
Wed, 13 May 2009 17:12   |
|
koldo wrote on Sun, 10 May 2009 09:50 |
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
|
Hello Koldo,
Can you emulate shortcut event [Ctrl]+[C]+[C] in your example?
Sorry for incompetence, but in this event I'm new!
|
|
|
 |
|
New functions to SysInfo
By: koldo on Wed, 03 December 2008 09:57
|
 |
|
Re: New functions to SysInfo
By: forlano on Wed, 03 December 2008 21:27
|
 |
|
Re: New functions to SysInfo
|
 |
|
Re: New functions to SysInfo
By: koldo on Mon, 23 March 2009 18:44
|
 |
|
Re: New functions to SysInfo
By: tojocky on Tue, 24 March 2009 09:19
|
 |
|
Re: New functions to SysInfo
By: koldo on Thu, 02 April 2009 12:01
|
 |
|
Re: New functions to SysInfo
By: tojocky on Fri, 08 May 2009 16:03
|
 |
|
Re: New functions to SysInfo
By: koldo on Sat, 09 May 2009 09:15
|
 |
|
Re: New functions to SysInfo
By: tojocky on Sat, 09 May 2009 11:09
|
 |
|
Re: New functions to SysInfo
By: koldo on Sat, 09 May 2009 15:15
|
 |
|
Re: New functions to SysInfo
By: koldo on Sat, 09 May 2009 16:42
|
 |
|
Re: New functions to SysInfo
By: tojocky on Sat, 09 May 2009 22:01
|
 |
|
Re: New functions to SysInfo
By: koldo on Sun, 10 May 2009 08:50
|
 |
|
Re: New functions to SysInfo
By: tojocky on Wed, 13 May 2009 17:12
|
 |
|
Re: New functions to SysInfo
|
 |
|
Re: New functions to SysInfo
By: koldo on Sun, 10 May 2009 22:08
|
 |
|
Re: New functions to SysInfo
|
 |
|
Re: New functions to SysInfo
By: tojocky on Mon, 11 May 2009 15:53
|
 |
|
Re: New functions to SysInfo
By: koldo on Thu, 28 May 2009 23:29
|
 |
|
Re: New functions to SysInfo
By: koldo on Sat, 06 June 2009 15:36
|
 |
|
Re: New functions to SysInfo
By: koldo on Wed, 15 July 2009 23:37
|
 |
 |
Re: New functions to SysInfo
|
 |
|
Re: New functions to SysInfo
By: tojocky on Wed, 17 February 2010 14:42
|
 |
|
Re: New functions to SysInfo
By: koldo on Wed, 17 February 2010 15:50
|
 |
|
Re: New functions to SysInfo
By: tojocky on Wed, 17 February 2010 18:20
|
Goto Forum:
Current Time: Tue Aug 26 09:31:14 CEST 2025
Total time taken to generate the page: 0.06492 seconds
|