Home » Questions » Computers [ Ask a new question ]

Software to move mouse to centre of newly focused window

Software to move mouse to centre of newly focused window

With the 4 monitor setup that I use one of the pitfalls is that I spend a lot of time moving the mouse cursor across 2 or more screens at a time.

Asked by: Guest | Views: 180
Total answers/comments: 2
Guest [Entry]

"Edit: an easier method!

AltTab

(For Windows XP and Vista)

AltTab is a compiled AutoHotKey script that just moves the mouse near the origin of the active window when you use the AltTab hotkey combination in Windows to bring another window to the forefront

The hard way:

Use AutoHotKey to move the mouse to the center on Alt+Tab:

~!Tab::
KeyWait, Alt
KeyWait, Tab
WinGetPos, X, Y, width, height, A
center_x:=x+width/2
center_y:=y+height/2
MouseMove,center_x,center_y,
return

There you go Tiago ;-)"
Guest [Entry]

"I let myself decompile the @IvoFlipse's AltTab.zip script, and then tweak it a bit to move the mouse to the center of the window, here's the result:

; After Alt-Tab, move mouse to center of newly activated window.
; superuser.com/questions/14868/software-to-move-mouse-to-centre-of
; - updated based on http://www.favessoft.com/AltTab.zip;
; - modified to try to move to center of window.
~!Tab::
KeyWait, Alt
KeyWait, Tab
WinGetPos,x,y,width,height,A
While (x < 0 Or y < 0)
{
Sleep,100
WinGetPos,x,y,width,height,A
IfGreater,A_Index,2,Break
}
MouseMove,width/2,height/2
return"