Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
Would it also help if mousing over a windows makes it focused? –  Ivo Flipse Jul 29 '09 at 7:23
    
Nah. It's the mouse moving not the clicking that takes time. –  LachlanG Jul 29 '09 at 7:34

5 Answers 5

up vote 4 down vote accepted

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

share|improve this answer
    
It works fine for a real machine but unfortunately doesn't work for a VMWare Workstation guest. Any suggestions? –  LachlanG Sep 9 '09 at 1:25

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.
;  http://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
share|improve this answer

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.

share|improve this answer
    
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 Dec 10 '12 at 15:16

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
share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.