Welcome to shell: revealed Sign in | Join | Help
in Search

An X-Mouse - Windows Follow Mouse feature for Vista

Last post 01-07-2009, 12:53 PM by serkowski. 19 replies.
Sort Posts: Previous Next
  •  11-12-2006, 2:55 PM 5726

    An X-Mouse - Windows Follow Mouse feature for Vista

    Was cruising by and lurking a little, saw a post where someone needed an X-Mouse function. Thought i'd share what I had discovered and posted already over at msfn.org to help out. Enjoy :)

    An X-Mouse - Windows Follow Mouse, feature is something I miss in Windows. In WnXP we could enable this by using the Power Toys. The Power Toys don't seem to work to enable this feature in Vista, but you can still have this if you like by doing the below, but before proceeding remember to back up these registry entries first in case something goes wrong:

    (This reg entry change not only makes the window active but makes it the forground window by bringing it foward on top of other windows when the mouse is over it.)

    1. Open up Regedit and browse to [HKEY_CURRENT_USER\Control Panel\Desktop]

    2. Look for the REG_Binary key "UserPreferencesMask" in the right pane. You will see its value as a string of hex numbers. Mine was hex 98,12,03,80,10,00,00,00.

    3. Next you need to add the hex value '41' to the first hex value on the left in the hex string found in step 2. Using the hex string I have as an example: 98h + 41h = d9h. You can use the Calculator (in scientific mode) in Vista to do this simple addition. My new hex value, using my example, string now becomes d9,12,03,80,10,00,00,00

    4. Next, Right click on the "UserPreferencesMask" key and choose 'Modify',then alter the original value of "UserPreferencesMask" to your new value found in step 3.

    5. Next, at the same [HKEY_CURRENT_USER\Control Panel\Desktop] registry location right click in the right pane and choose to add a new DWORD (32-bit) value and name this value "ActiveWndTrkTimeout". Next right click on your new "ActiveWndTrkTimeout" DWORD and choose modify and put in the time (in milliseconds) that suits you for the mouse switching between windows.

    6. Close Regedit and re-boot.

    Now for multiple windows open on the desktop, the window the mouse pointer is on will become the active window and come to the foreground without having to click on it. You may need to play with the value for "ActiveWndTrkTimeout" a little to get it correct. These are the values (below) I used to test with and the time for the mouse to remain over a window before its bought forward is 3 seconds (3000 miliseconds). Experiment with your time and find something that suits you:


    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Control Panel\Desktop]
    "UserPreferencesMask"=hex:d9,12,03,80,10,00,00,00
    "ActiveWndTrkTimeout"=dword:00000bb8
  •  11-13-2006, 8:33 AM 5731 in reply to 5726

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    Wow! Thanks man. I really love you right now... Smile
    "I don't need your civil war,
    Your power hungry sellin' soldiers, In a human grocery store, Ain't that fresh,
    I don't need your civil war, I don't need one more war"
    - Guns N' Roses - Civil war
  •  01-04-2007, 2:40 PM 6284 in reply to 5726

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    Thanks so much; I have dual monitors and this is crucial when switching between a maximized window on each one.
  •  02-19-2007, 4:22 PM 6632 in reply to 5726

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    The registry edit you specified abobe activates the Focus-Follows-Mouse feature indeed, but it also activates Raise-Window-When-Focused that is really really annoying.

    With XP/TweakUI you had the option to enable or disable window raise, do you happen to know which registry key activates/deactivates that?  

     Thanks  

    CG
     

    Filed under:
  •  03-07-2007, 1:38 PM 6808 in reply to 6632

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    I used TweakUI to modify the key spooky identifies (HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferencesMask) and tweaked it to not Raise-Window-When-Focused...

    It looks like (not tested on Vista) that to only do Focus-Follows-Mouse it is just +1 to the first value instead of +41.

    Try +1 and let us know...

    -caseman

  •  03-12-2007, 8:32 PM 6866 in reply to 6808

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    Adding +1 worked for me on vista.

  •  03-14-2007, 12:17 PM 6880 in reply to 6866

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    FYI

    Virtual desktop manager called "goScreen" (www.goscreen.info) has X-Mouse feature:

    http://www.goscreen.info/gs/shots/gsprop19.gif

    It works differently than the standard MS implementation; but I personally like it more.

  •  03-22-2007, 2:28 PM 6952 in reply to 6880

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    BTW, you should use the API to set this instead of hacking the registry directly. See http://blogs.msdn.com/oldnewthing/archive/2005/03/09/390706.aspx  (The API is SystemParametersInfo, with spi_setactivewindowtracking).
  •  04-16-2007, 11:52 AM 7067 in reply to 6952

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    It's very RARE that I post to most boards but this time, I feel compelled.

    The lack of an X-raise feature in Vista has been a pain in the butt for me.  I've been searching high and low for a tool that would support (enable) it but until today, no success. 

    I'd just like to say thanks to Spooky and caseman.  Your registry mod and caseman's addition (+1) for just altering the focus of the window works perfectly in Vista Home Premium.

    Thanks to both!!!

  •  04-18-2007, 12:02 PM 7077 in reply to 7067

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

     I can only echo the thoughts of gelewis.  I too had been searching high and low for a decent replacement for True-X-Mouse on XP.

     This works on Vista Business although the Registry value in my case was:

        9E 3E 07 80 12 00 00 00

     Which I merrily changed to:

       9F 3E 07 80 12 00 00 00

     Crossed all fingers/toes/arms/legs and rebooted and viola!

     

    Thanks again!

     

    Google bait line so that others can find this easier: focus follows mouse windows vista  sloppy focus windows vista  pointer focus windows vista true X Mouse vista alternative

  •  04-27-2007, 6:33 PM 7109 in reply to 5726

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    I just got a new system with Windows Vista Home Basic. It had the feature to suck your account from your old system. I took advantage of this and, after the transfer, I had the XMouse raise window feature which I feel I can't live without. My problem is that it raises windows INSTANTLY. I tried setting the ActiveWndTrkTimeout generously detailed above, but nothing changes. The window under the mouse raises instantly (yes, I restart my system afterwards). Anyone have any ideas? Thanks so much in advance!
  •  06-21-2007, 8:45 AM 7269 in reply to 7109

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    You may have adjusted the, already existing, ActiveWndTrackTimeout key.

    I don't know what this key is for but, for XMouse timeout to work, you have to add a new ActiveWndTrkTimeout key (please note Trk vs Track).

     Cheers

     

  •  06-24-2007, 5:39 AM 7273 in reply to 7269

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    If you need to quickly activate x-mouse on Vista and you dont care about msecs too much:

    Control Panel > Ease of Access (sic!) > Make the mouse easier to use >
    Activate a window by hovering over it with the mouse.

    Regards,
    Wembley

    BTW. I wonder when they will discover that always-on-top is an essential feature... :)
  •  10-04-2007, 1:37 PM 7512 in reply to 7273

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    This is great and I too thank you all for this.

    My problem is the mouse overrides the active window selection of the ALT-tab key selection. Before, the mouse would override only once it was moved. This functionality would be great! Anyone dealt with this?

    Thank a lot!
    Rick

  •  01-23-2008, 9:03 AM 7690 in reply to 6952

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    jazzdelightsme:
    BTW, you should use the API to set this instead of hacking the registry directly. See http://blogs.msdn.com/oldnewthing/archive/2005/03/09/390706.aspx  (The API is SystemParametersInfo, with spi_setactivewindowtracking).

     

    WoW! its been a while since i've been here. Was just catching up some and found this post again about the X-Mouse thing.

    About the API. Yep, thats all well and good...but......the api only mimics the registry entries, for example -

    SPI_SETACTIVEWNDTRKTIMEOUT for the API = the registry entry for "ActiveWndTrkTimeout"

    Using the API is all well and good if you want to have another something application start up and needing to be running to use it each time you use Vista, but.....why use the API when the registry is right there to have your settings persist? Its part of what the registry is for anyway, so changes persist, its what the PowerToy from MS for WinXP did for this 'feature' addition, it simply changed the registry values and that was it. Using the API would be fine if it was something more then this perhaps, like something that was not native to Vista and was an Add-On where an application needed to be running to have the non-native thing enabled, but using the API for this is IMHO not needed, then again to each his own.

  •  07-10-2008, 1:45 PM 8006 in reply to 7690

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    The nice thing is if you use the API, and the registry entries change, you don't break something (because the API will accommodate).  Also, if you use the API, the changes take effect immediately.

    To this end, I've put together a python script that will enable/disable/toggle xmouse from the command-line.  You need Python and pywin32 installed, but after that, it just works.  I haven't implemented the tracking delay, but that would be fairly easy to extend.  Perhaps someone would want to port this to VB so it just runs without having Python?

    Regards,

    Jason

    #!python
    # $Id$
    import sys
    import win32con
    import win32gui
    """
    Usage: %s {enable, disable, toggle}
    """
    set_constant = win32con.SPI_SETACTIVEWINDOWTRACKING
    get_constant = win32con.SPI_GETACTIVEWINDOWTRACKING
    def set(value):
    	win32gui.SystemParametersInfo(set_constant, value)
    def enable():
    	print "enabling xmouse"
    	set(True)
    	
    def disable():
    	print "disabling xmouse"
    	set(False)
    def toggle():
    	value = win32gui.SystemParametersInfo(get_constant)
    	print "xmouse: %s -> %s" % (value, not value)
    	set(not value)
    	
    def run():
    	try:
    		action = sys.argv[1]
    	except IndexError:
    		action = 'toggle'
    	try:
    		globals()[action]()
    	except KeyError:
    		print >> sys.stderr, usage
    if __name__ == '__main__':
    	run()
  •  08-07-2008, 3:35 PM 8043 in reply to 6808

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    I used exactly what spooky suggested and it worked like a champ. Thanks so much, spooky. Now that I have it working as I wanted, I'm reluctant to experiment with my work PC. But finding the good tweak here got me to sign up so I could thank you. Smile onlineguy
  •  09-07-2008, 1:10 PM 8086 in reply to 5726

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    Dude You Rock!

    Special thanks to caseman for the +1 

    I may even learn to like Windows one of these days .... now if they had a tightly integrated bash shell

    Thanks all!

     

     

  •  12-15-2008, 8:59 PM 8204 in reply to 7273

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    I've been using this feature for quite some time and it works quite well for most stuff.

    However, I've now decided to turn it off because it has an undesired interaction with web text input (which I do a lot of). 

    With this feature enabled, at unspecific time intervals, the text cursor position (where you are typing) gets reset to the pointer position (where your mouse happens to be). So whilst you are typing away, all of a sudden the characters start getting inserted elsewhere in the textarea - usually into the middle of a paragraph you already typed.

    This can be quite annoying. 

     

  •  01-07-2009, 12:53 PM 8217 in reply to 8204

    Re: An X-Mouse - Windows Follow Mouse feature for Vista

    Hmm,  I'm now running Vista at my employer, so will see if I get this similar behavior that I saw in XP, but never connected to X-mouse.  In my case, I'd lose focus from the window I was typing in.  I never really figured out a pattern, but sometimes nothing had focus, so what I'd type just disappeared, and other times, my text would be in a different window.  It would happen once every couple weeks, so not annoying enough to turn it off.

     Another annoyance that's still there is that Outlook's pulldown menus (such as selecting appointment time) become unusable from the mouse.  As soon as the pointer is moved below the text box, the pulldown vanishes.  Workaround is to open the pulldown by mouse, then use arrow keys to select.  A bit awkward, but usable.  So far this is an issue only with Outlook and some other 3rd party app I was using several years ago.

    So perhaps Outlook (2003) is using the wrong API for the pulldown menus?  Since other apps seem to be unaffected.

     

    -Tom

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems © 2006 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement.