|
|
Home » Developing U++ » UppHub » New functions to SysInfo
New functions to SysInfo [message #19427] |
Wed, 03 December 2008 09:57  |
 |
koldo
Messages: 3435 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
After this first group of functions I want to include in January functions to handle with:
- Change or retrieve window size and position
- Screen capture: Certain window or all the screen
--- Image
--- Video
- Simulate user input
--- Mouse move and click without a mouse
--- Keyboard clicking without a keyboard
Best regards
Koldo
Best regards
Iñaki
|
|
|
|
|
|
Re: New functions to SysInfo [message #20575 is a reply to message #19427] |
Tue, 24 March 2009 09:19   |
|
koldo wrote on Wed, 03 December 2008 10:57 | Hello all
After this first group of functions I want to include in January functions to handle with:
- Change or retrieve window size and position
- Screen capture: Certain window or all the screen
--- Image
--- Video
- Simulate user input
--- Mouse move and click without a mouse
--- Keyboard clicking without a keyboard
Best regards
Koldo
|
NICE FUNCTION! I'LL BE GLAD TO TEST IT!
|
|
|
Re: New functions to SysInfo [message #20731 is a reply to message #19427] |
Thu, 02 April 2009 12:01   |
 |
koldo
Messages: 3435 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
I will insert these functions in Bazaar this afternoon
void Mouse_LeftClick();
void Mouse_MiddleClick();
void Mouse_RightClick();
void Mouse_LeftDblClick();
void Mouse_MiddleDblClick();
void Mouse_RightDblClick();
void Mouse_SetPos(long x, long y, long windowId);
void Mouse_GetPos(long &x, long &y);
void Keyb_SendKeys(String text, long finalDelay = 100, long delayBetweenKeys = 50);
void Window_GetRect(long windowId, long &left, long &top, long &right, long &bottom);
void Window_SetRect(long windowId, long left, long top, long right, long bottom);
bool Window_SaveCapture(long windowId, const char *fileName);
Usually I prefer to wait an release things for Linux and Windows but this time I have few time so I have only done them for Windows.
Tested in MinGW and MSC9 in XP.
All feedback is acknowledged.
Best regards
Koldo
Best regards
Iñaki
|
|
|
Re: New functions to SysInfo [message #21193 is a reply to message #20731] |
Fri, 08 May 2009 16:03   |
|
Hello Koldo!
Do you know how can I handle global shortcut in U++?
I want to realized global shortcut for Google Translation!
Somebody know how can I handle a global shortcut for win32 and Linux?
Thanks in advance!
|
|
|
|
Re: New functions to SysInfo [message #21203 is a reply to message #21202] |
Sat, 09 May 2009 11:09   |
|
koldo wrote on Sat, 09 May 2009 10:15 | Hello tojocky
As I did not know about that I have taken this definition from Gnome, but seems to be useful everywhere:
Quote: | Global shortcut keys enable you to use the keyboard to perform tasks related to your desktop, rather than tasks on the currently selected window or application
|
It seems to be related to the desktop system (gnome, kde)
Best regards
Koldo
|
I need this handle in windows too!
|
|
|
|
|
Re: New functions to SysInfo [message #21212 is a reply to message #21205] |
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!
|
|
|
|
|
|
|
Re: New functions to SysInfo [message #21282 is a reply to message #21252] |
Mon, 11 May 2009 15:53   |
|
Mindtraveller wrote on Sun, 10 May 2009 23:50 | Koldo, if you know better solution for POSIX - please tell. IMO xbindkeys is better than local cycle at least because it will make ONE cycle for ALL executed programs, and even if you run a number of programs based on U++/xbindkeys, you`ll get only ONE cycle. But I`m not really shure if it is portable solution. So one needs to investigate which window managers / distributives have this utility and which are not.
|
Someone knows what uses native Linux and MacOS.
Is possible to add this in U++?
|
|
|
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!
|
|
|
|
|
Goto Forum:
Current Time: Wed May 14 11:01:39 CEST 2025
Total time taken to generate the page: 0.00497 seconds
|
|
|