Started using this program yesterday and I love it so far.
I was wondering if there was a way I can have a script use mouse positions inside the application itself. From what I have seen so far, the mouse location is based on monitor position, so I cant move the app at all. Is there some way to accomplish that? I debated using the built in window resolution and then have it move the application to the same spot each time the script is executed, but I wondered if there was an easier way first.
Thanks!
Relative Mouse Position Help
Moderators: Dorian (MJT support), JRL
Re: Relative Mouse Position Help
Not a bad idea to move the application window to the same location and resize it to the same size within the script but not always necessary either.I debated using the built in window resolution and then have it move the application to the same spot each time the script is executed...
As for mouse moves, there are two functions for moving the mouse. MouseMove> places the mouse cursor relative to the absolute coordinates of the screen. MouseMoveRel> (mouse move relative) places the mouse cursor relative to the 0,0 coordinates of the currently focused window. Therefore, good practice would have you SetFocus> on the window you are moving relative to prior to moving the mouse.
-
- Newbie
- Posts: 8
- Joined: Fri Sep 02, 2016 7:42 pm
Re: Relative Mouse Position Help
Thank you for your reply!JRL wrote: MouseMoveRel> (mouse move relative) places the mouse cursor relative to the 0,0 coordinates of the currently focused window. Therefore, good practice would have you SetFocus> on the window you are moving relative to prior to moving the mouse.
If I am understanding you correctly
Code: Select all
SetFocus>ApplicationWindow
MoveMouseRel>X,Y
Re: Relative Mouse Position Help
SetFocus> makes the application window the active window. No need to also click on the window with the mouse.
To get the correct mouse coordinates to use MouseMoveRel> I usually move my window so the upper left corner of the window is at the 0,0 position of the screen. However that is just old habit. There is now a better way.
In the editor you can pick the drop down menu associated with the mouse coordinate display. One of the choices is "Relative". After picking the "Relative" menu item, the display will show the mouse coordinates relative to whatever window the mouse cursor is hovering over. So, then, yes, just use those numbers as the X,Y parameters in the MouseMoveRel> function.
If you also pick "Follow Cursor" from that same drop down menu, the cursor coordinates will display next to the mouse cursor... AND if you click both the left and right mouse buttons simultaneously, the mouse cursor coordinates will be placed in the clipboard. All you need do is paste them in behind MouseMoveRel>.
To get the correct mouse coordinates to use MouseMoveRel> I usually move my window so the upper left corner of the window is at the 0,0 position of the screen. However that is just old habit. There is now a better way.
In the editor you can pick the drop down menu associated with the mouse coordinate display. One of the choices is "Relative". After picking the "Relative" menu item, the display will show the mouse coordinates relative to whatever window the mouse cursor is hovering over. So, then, yes, just use those numbers as the X,Y parameters in the MouseMoveRel> function.
If you also pick "Follow Cursor" from that same drop down menu, the cursor coordinates will display next to the mouse cursor... AND if you click both the left and right mouse buttons simultaneously, the mouse cursor coordinates will be placed in the clipboard. All you need do is paste them in behind MouseMoveRel>.
-
- Newbie
- Posts: 8
- Joined: Fri Sep 02, 2016 7:42 pm
Re: Relative Mouse Position Help
JRL wrote: if you click both the left and right mouse buttons simultaneously, the mouse cursor coordinates will be placed in the clipboard. All you need do is paste them in behind MouseMoveRel>.
That is a time saver, thank you so much!