Page 1 of 1

Can I get the current mouse position?

Posted: 13 Apr 2018 03:25
by kuiwu_cn
Can I get the current mouse position?

Re: Can I get the current mouse position?

Posted: 13 Apr 2018 03:36
by jupe
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:

Code: Select all

::screen;
eg. Ouput :

GetCursorPos = 882, 536

Re: Can I get the current mouse position?

Posted: 13 Apr 2018 03:42
by kuiwu_cn
Thank you very much.

Re: Can I get the current mouse position?

Posted: 13 Apr 2018 03:45
by kuiwu_cn
Can the return string be written to a variable?

Re: Can I get the current mouse position?

Posted: 13 Apr 2018 06:02
by highend
Not with that screen command.

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";
Get mouse position.zip

Re: Can I get the current mouse position?

Posted: 13 Apr 2018 06:32
by kuiwu_cn
Thank you very much.

Re: Can I get the current mouse position?

Posted: 19 Apr 2018 14:56
by admin
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