PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Xmouse (focus follows mouse)

Open belg4mit opened this issue 6 years ago • 23 comments

Please update xmouse!

I have a freeware tool that is serviceable, but it does not always play well with various pop-up UI elements, such as color palettes in tools like FileMaker, or the Windows system tray.

belg4mit avatar May 12 '19 00:05 belg4mit

Hi @belg4mit ,

Xmouse would be the PowerToy for Windows 95 that would focus Windows under the mouse without requiring a click. Is this the specific feature you're requesting from this PowerToy?

jaimecbernardo avatar May 13 '19 09:05 jaimecbernardo

Yes.

belg4mit avatar May 13 '19 11:05 belg4mit

I personally think Xmouse behavior/functionality should be in the core OS window manager in any modern OS. It can be disabled by default, but this discussion is getting quite old :) Focus follows mouse (with option to raise window underneath cursor, default no) should not be a "powertoy" or "tweakui" function, but if that is what we get, then I'm all for at least getting the functionality.

joho1968 avatar May 15 '19 06:05 joho1968

A really reliable "focus follows mouse" is something I would really like built into Windows. X11 got this really right. But Xmouse for example also raises some windows unintentionally, which makes it awkward to use long term.

klaernie avatar Sep 06 '19 19:09 klaernie

Would love that too! Currently having that "simulated" via "Winaero Tweaker" (great utility btw!) X-mouse option, but the problem with Winaero Tweaker is that it also changes focus in input fields (e.g. in Outlook when typing To: Subject: Body etc.) and I would NOT like to have that to happen. Just the app windows.

tjsuominen avatar Sep 11 '19 09:09 tjsuominen

+1 for this as well.

I've used the reg hacks since windows Vista because true x-mouse quit working after XP (I think that's right... been a while)

While Win10 has follow, it interferes horribly with the start bar and app hovers, regardless of how you set the timing. I never use raise because it defeats the purpose. The one thing that took me a while to get used to with true mouse was the "Click the title bar to raise". I hated it at first but came to actually like and prefer it. It was baked into the app and you couldn't change it, but ultimately you could click all day long inside a "lowered" window and it would never raise to the front unless you clicked the title bar. It made data copy between spreadsheets, or across browser windows amazing to work with. Now, you have to make sure you're in the right field before bringing up the raised window and hope to god you don't accidentally click the lower window...

IMO, this functionality needs to be more than "in the registry". The reg settings only go so far but since Windows hasn't ever been designed around x-mouse style workflow, everything I have tried have been simple hacks or registry tweaks that are very half-baked.

Those of us looking for a good XMouse enhancement within PowerToys, are looking for something that lets us work faster, gets out of our way and ultimately "just works".

philsward avatar Mar 13 '20 07:03 philsward

Since Microsoft loves Linux, I can't see why this isn't implemented ...

joho1968 avatar Mar 13 '20 08:03 joho1968

https://winaero.com/turn-on-xmouse-active-window-tracking-focus-follows-mouse-pointer-feature-in-windows-8-1-windows-8-and-windows-7/

Jay-o-Way avatar Mar 27 '21 14:03 Jay-o-Way

@Jay-o-Way too bad the MS implementation of xmouse sucks 😕

Not to mention it constantly rewrites the regkey on its own that determines the focus timing.

Yes, there are xmouse settings baked into the OS, but alas, this feature request is to actually make it work properly, especially with Win 10.

philsward avatar Mar 27 '21 16:03 philsward

@crutkas (off topic) I'm surprised, almost shocked, to see the amount of tweaks in WinAero, so similar to the TweakUI we know from before. Maybe we can open convo to work together? Because I know there are plenty of requests that this app already may have a solution for.

Jay-o-Way avatar Mar 27 '21 22:03 Jay-o-Way

@Jay-o-Way any API / regkey must publicly document for PowerToys to use it.

But yes, we this could be a good route to scale.

crutkas avatar Mar 27 '21 23:03 crutkas

@crutkas The best implementation of Focus Follows Mouse on Windows is @joelpurra 's X-Mouse Controls. It's open-source and quite functional (donation worthy for me), but it does have limitations with UI elements like menus from the notification tray ("true" focus-follows-mouse keeps focus on the last application when no application (the desktop) has focus).

These are probably limitations related to Windows itself, so the only way to work around this would be to have the behavior built in. But maybe his implementation would be a better place to start since it's open.

traycerb avatar Apr 19 '21 04:04 traycerb

I'm using this tool https://github.com/joelpurra/xmouse-controls/ to enable focus follow mouse. As many people said before, this mostly works, but some applications (for me mostly Visual Studio) jump up to front when they get focus. And the start menu and various context menus act strange (disappear to soon).

Maybe you Microsoft guys can take it internally to the right people to fix the Windows OS itself, so that focus does not raise windows.

kajetan-kazimierczak avatar Jun 30 '21 11:06 kajetan-kazimierczak

I'm using this tool https://github.com/joelpurra/xmouse-controls/ to enable focus follow mouse. As many people said before, this mostly works, but some applications (for me mostly Visual Studio) jump up to front when they get focus. And the start menu and various context menus act strange (disappear to soon).

Maybe you Microsoft guys can take it internally to the right people to fix the Windows OS itself, so that focus does not raise windows.

This here isn't the Windows team. If you want to provide feedback for Windows please file it in the Feedback Hub.

noraa-junker avatar Jun 30 '21 13:06 noraa-junker

I have fingers crossed that this (X-mouse) gets implemented in Power toys some day. Will need to check other suggestions to.

tjsuominen avatar Jun 30 '21 14:06 tjsuominen

I have fingers crossed that this (X-mouse) gets implemented in Power toys some day. Will need to check other suggestions to.

@tjsuominen To see this realistic if you don't know someone who wants to implement it or you don't do it yourself, it's likely not going to happen by just crossing fingers. I'm sorry. But never lose your hope!

noraa-junker avatar Jun 30 '21 15:06 noraa-junker

@Aaron-Junker Sorry, seems I failed badly to raise positive discussion around the topic. But clearly that's not the scope here, right? All the best.

tjsuominen avatar Jun 30 '21 16:06 tjsuominen

Sorry to ask, is this feature is already in backlog/planned? There are several tickets that were closed due to marked as duplicate to this, but it seems this ticket don't have much updates either.

mangkoran avatar Nov 01 '24 02:11 mangkoran

I would also like to see this feature. The way I achieve focus-follows-mouse for now is with a registry hack:

  1. Open up the key HKEY_CURRENT_USER\Control Panel\Desktop.

  2. Change the most significant byte of the REG_BINARY UserPreferencesMask to be 01. That is, if the current value is df 3e 03 80 12 00 00 00, then change it to 01 3e 03 80 12 00 00 00.

  3. Change or add the REG_DWORD ActiveWndTrkTimeout to the number of milliseconds to wait before focus shifts to the window under the mouse. I like a value of 0x80 (128ms).

    • It seems that this value typically doesn't exist, but there is a similarly named ActiveWindTrackTimeout. That value is either non-effective or insufficient -- leave it be.
    • NOTE: Adding this delay is not optional. If you don't set it, you'll go insane trying to access certain GUI elements (like the systray overflow window).

adam-p avatar Nov 15 '24 11:11 adam-p

  • NOTE: Adding this delay is not optional. If you don't set it, you'll go insane trying to access certain GUI elements (like the systray overflow window).

100%

This is why I say: "IMO, this functionality needs to be more than in the registry. The reg settings only go so far but since Windows hasn't ever been designed around x-mouse style workflow, everything I have tried have been simple hacks or registry tweaks that are very half-baked."

It would be soo nice to see a full featured x-mouse for windows instead of the hackjob workarounds we have to deal with today. It wants to follow EVERYTHING the mouse does instead of windows. The reg hack shouldn't affect the start menu, but it does. It shouldn't affect the pop-ups from the taskbar, but it does. It shouldn't affect the task tray, but it does. The reg hack is exactly that.

Playing with timing helps, but it somehow magically gets changed back to a lower time value and screws it all up. X-Mouse Controls seems to fix this bug fortunately.

Why can't we have nice things?? 😜

philsward avatar Feb 11 '25 20:02 philsward

Playing with timing helps, but it somehow magically gets changed back to a lower time value and screws it all up.

I don't think I've ever had that happen. I only ever do the registry hack and then forget about it until I get a new computer.

adam-p avatar Feb 16 '25 14:02 adam-p

This seems to be achievable by basically using(including delay):

Image

Source: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa

Based on rough look, X-Mouse Controls also seems to be using same thing.

Any reason it's not been added/done same way in PowerToys?

Anutrix avatar May 11 '25 21:05 Anutrix

I would love to see better mouse settings integrated with powertoys

Ferrb9579 avatar May 21 '25 09:05 Ferrb9579