Posts: 13
Threads: 6
Joined: Oct 2012
Hi
I have 2 monitors.
I want to move the cursor (mouse) on the second monitor (and center cursor on the screen) and vice versa.
Is it possible to make that macro?
How to do it?
Best regards
Posts: 12,071
Threads: 140
Joined: Dec 2002
Macro
Macro2550
int monitor=ListDialog("1[]2" "Monitor" "Center mouse")
if(!monitor) ret
int x y cx cy
GetWorkArea x y cx cy 1 monitor
mou cx/2+x cy/2+y
Posts: 13
Threads: 6
Joined: Oct 2012
Thanks Gintaras,
macro works great, but...I will 2 macros without dialog windows.
macro 1 (shortcut 1) = move cursor on the monitor 1 and center
macro 2 (shortcut 2) = move cursor on the monitor 2 and center
How can i do that?
Posts: 12,071
Threads: 140
Joined: Dec 2002
remove ListDialog and use 1 or 2 instead of the monitor variable.
Posts: 13
Threads: 6
Joined: Oct 2012
Yeah! Thanks!
And now...cursor is moved to the next monitor AND...
how to make active window "under" cursor without clicking it?
Posts: 12,071
Threads: 140
Joined: Dec 2002
Posts: 13
Threads: 6
Joined: Oct 2012
My code:
int monitor=2
if(!monitor) ret
int x y cx cy
GetWorkArea x y cx cy 1 monitor
mou cx/2+x cy/2+y
mou 0.5 0.5 win
And...cursor is back to the first monitor
Without last line is ok.
What's wrong?
Posts: 12,071
Threads: 140
Joined: Dec 2002
replace win to FirstWindowInMonitor(monitor)
Whole macro:
mou 0.5 0.5 FirstWindowInMonitor(2)
Posts: 13
Threads: 6
Joined: Oct 2012
Now is ok - cursor on 1 or 2 monitor, but window is still not active - i must to click to activate the window
Is it possible to auto-activate window (without clicking) "under" mouse cursor?
Posts: 13
Threads: 6
Joined: Oct 2012
Something like this:
http://www.sevenforums.com/tutorials/90 ... nable.html
but not permanently on or off.
I would like to have the macro - "move mouse to the next monitor + make window active" - help me please Gintaras.