Can I get the current mouse position?
Re: Can I get the current mouse position?
This probably isn't going to help you, it depends on what you want the coordinates for, but you can run the following and get info on mouse coordinates in a popup window:
eg. Ouput :
GetCursorPos = 882, 536
Code: Select all
::screen;
GetCursorPos = 882, 536
Re: Can I get the current mouse position?
Can the return string be written to a variable?
Re: Can I get the current mouse position?
Not with that screen command.
You could use something like this instead:
You could use something like this instead:
Code: Select all
$clip = <clipboard>;
run "<path to get mouse position.exe>", "%TEMP%", 2, 0;
$x = gettoken(<clipboard>, 1);
$y = gettoken(<clipboard>, 2);
copytext $clip;
status "X: $x, Y: $y";
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60598
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Can I get the current mouse position?
Next version it will be a little more comfortable:
Code: Select all
+ SC get got a new named argument "cursorpos" to return the mouse cursor
position on screen.
Syntax: get("cursorpos", param1)
param1:
x,X: X position
y,Y: Y position
[else]: Separator between X and Y position
If empty it defaults to ";"
return: Mouse cursor position on screen.
Examples:
echo get("cursorpos"); //425;237
echo get("cursorpos", ","); //339,488
echo get("cursorpos", ", "); //339, 488
echo get("cursorpos", "X"); //1018
echo get("cursorpos", "y"); //414
FAQ | XY News RSS | XY Twitter