3

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.

I would like a piece of software for WinXP that when a window receives the focus, if the mouse is not already within that window, moves the mouse to the centre of that window.

Any ideas?

2
  • Would it also help if mousing over a windows makes it focused?
    – Ivo Flipse
    Commented Jul 29, 2009 at 7:23
  • Nah. It's the mouse moving not the clicking that takes time.
    – LachlanG
    Commented Jul 29, 2009 at 7:34

5 Answers 5

5

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 ;-)

1
  • It works fine for a real machine but unfortunately doesn't work for a VMWare Workstation guest. Any suggestions?
    – LachlanG
    Commented Sep 9, 2009 at 1:25
1

The AutoHotKey script above didn't work for me, I had to make some minor changes. MouseMove is relative to the current window position, not the screen position. It also would not always move the mouse to the window if it was minimized. I added a Sleep statement to work around that.

~!Tab::
KeyWait, Alt
KeyWait, Tab
Sleep 300
WinGetPos,,, width, height,A
center_x:=width/2
center_y:=height/2
MouseMove,center_x,center_y
return
1

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.
;  https://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
1
  • as of 2020: this works great in Win10. love the modification too
    – JasonS
    Commented Sep 23, 2020 at 18:13
0

The only software setting I am aware of is in the Microsoft IntelliMouse software which allows you to do a Snap to Default Button. This however only works for dialog boxes.

I did however find this registry hack, however I haven't tried it myself.

  • Start
  • Run
  • Regedit
  • Make Changes
  • Exit RegEdit
  • Reboot
Registry Key: HKEY_CURRENT_USER\Control Panel\Mouse
Data Type: REG_DWORD [Dword Value] 
Value Name: ActiveWindowTracking
Setting for Value Data: 
[0 = ActiveWindowTracking Disabled]
[1 = ActiveWindowTracking Enabled]

Alternatively you can also have a look at using AutoHotKey. It might have a way to map this from some forum entries I have read.

-1

It does not work with two screens attached. It seems that the script thinks the window on screen #2 is on screen #1 and move the screen to the right position but on the wrong screen.

1
  • Have you tried the others mentioned here? Your 'Answer' is better posted as a comment to the answer to which it applies, as it is not an answer.
    – HaydnWVN
    Commented Dec 10, 2012 at 15:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .