Any Clever Methods of Activitating Window Under Mouse (prior to additional commands/functions)?

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
Forum rules
Please read the forum rules before posting for the first time.
The more information you can provide, the quicker and more accurately someone can help.
NOTE: To reduce spam, new users can not post links, files or images until they have at least 4 posts.
mousetrap
New User
Posts: 9
Joined: Tue Oct 28, 2025 8:39 pm

Any Clever Methods of Activitating Window Under Mouse (prior to additional commands/functions)?

Post by mousetrap »

XMBC Version: 2.20.5
Installed or Portable version: Portable
Windows Version: 11
How long have you used XMBC?: a few days :D
What language and keyboard layout do you use in Windows?: English

Question:
I doubt there is a way, but wanted to check if anyone has any clever methods for activating/focusing the window under the mouse prior to then performing some additional functions? For context, I have a Chording setup where I hold down my Secondary button and then click my Primary button and it sends the Ctrl-W sequence to close that window (it is super handy!). But sometimes I am not paying attention to which window has focus and so I close the wrong window. :roll: :lol: So I'm trying to see if there is a way to add something else into the sequence such that the window under my mouse gets focus first and then my Simulated Keys are sent.

I also want to do something similar for when I send a Minimize Window command.

I know there is a way to scroll the window under the mouse, so I thought perhaps there maybe just might be a way to do what I'm seeking above as well. :D

Thanks in advance for any ideas, pointers, etc!

Edit: I just found and am going to experiment with the Window Mouse Accessibility setting Activate on Hover!
User avatar
phil
Site Admin
Posts: 7962
Joined: Sun Apr 06, 2003 11:12 pm

Re: Any Clever Methods of Activitating Window Under Mouse (prior to additional commands/functions)?

Post by phil »

The most obvious one, would be to send a left click first {lmb} to click on and activate the window. There are also some simkey tags to do this more specifically, like {activate}, {ACTIVATEPARENT}, {ACTIVATETOP} and {ACTIVATEP:<process.exe>} which might give more options
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 11 x64 24H2, AMD Ryzen 9950x3D, MSI x870E Tomahawk, 64GB DDR%,
nVidia RTX 2070s (still lol)
mousetrap
New User
Posts: 9
Joined: Tue Oct 28, 2025 8:39 pm

Re: Any Clever Methods of Activitating Window Under Mouse (prior to additional commands/functions)?

Post by mousetrap »

Oh, wow -- this is awesome! Thank you for your patience with me in my missing those details!! {ACTIVATE}{CTRL}W is working great for closing the window under my cursor. I would love to be able to also do the same thing for Minimize, but I'm not seeing (and forgive me if I'm just overlooking it!) a simkey tag for Minimize. Simkey tags for Scroll Window Left and Right would be nice as well, but not as important as Minimize (at the moment).
mousetrap
New User
Posts: 9
Joined: Tue Oct 28, 2025 8:39 pm

Re: Any Clever Methods of Activitating Window Under Mouse (prior to additional commands/functions)?

Post by mousetrap »

Hmm, a thing I'm running into is that not all programs work with {CTRL}W, but I prefer that sequence where supported because it closes tabs (for instance) before closing the entire program. Some programs only respond to {ALT}{F4}. I'm setting up Profiles to distinguish, but then I'm realizing I don't want to do {ACTIVATE}{ALT}{F4} for those programs because if that program happens to be active and I hover over a different program (eg, Firefox) I'll end up closing the hovered program (via {ALT}{F4}) when what I want is for the default Profile function of {CTRL}W to take effect.

So I guess the logic I'm wanting is:
Hover -> Chording -> Activate Window Under Mouse -> Apply Final Functions (based on which Profile this window belongs to).

Essentially I'm wanting to be able to use the same Chording sequence when hovering over any any window, and send either {CTRL}W or {ALT}{F4}, depending on which program I'm hovering over.

I doubt that is possible, but just sharing in case it is and you can enlighten me!
User avatar
phil
Site Admin
Posts: 7962
Joined: Sun Apr 06, 2003 11:12 pm

Re: Any Clever Methods of Activitating Window Under Mouse (prior to additional commands/functions)?

Post by phil »

OK, just looking through the simkeys available, and it seems there is no maximize/mizzen...

There should be a keyboard shortcut, WIN+DOWN ARROW, maybe MS have removed it? If not, {LWIN}{DOWN} might do it?
You may be able to use the Windows Message simkeys to send WM_SYWSCOMMAND message with the SC_MINIMIZE command - but it wont be obvious/easy.

Try this - I haven't tried it yet, it might work to minimize... but if not (and the keyboard shortcut does not work) it will require changes to XMBC to allow min/max(imize) from simkeys.
{POSTWM:0x0112,0xF020,0}

Unfortunately, as you suspected it is not possible to chain once chord across multiple applications - that is, if the button mapping executes on process/profile A it will never switch to another profile once you activate another process (change profiles), that's just not how it was designed to work (and would be a significantly large change to do that).

You might be able to make use of {KILL:<image/exe name>} like {KILL:notepad.exe} but that has other problems, particularly with multiple instances of the same program.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 11 x64 24H2, AMD Ryzen 9950x3D, MSI x870E Tomahawk, 64GB DDR%,
nVidia RTX 2070s (still lol)
mousetrap
New User
Posts: 9
Joined: Tue Oct 28, 2025 8:39 pm

Re: Any Clever Methods of Activitating Window Under Mouse (prior to additional commands/functions)?

Post by mousetrap »

Thank you so much for your efforts -- that is very kind of you!

Unfortunately, {POSTWM:0x0112,0xF020,0} did not work, but I am grateful for you taking the time to puzzle out that possibility.

WIN+DOWN ARROW might work for some folks, but I have software (MaxTo) that has custom regions setup and so that key combo just moves a given window into the nearest region (this might also be the case with vanilla Windows, as well, since there is basic region functionality built into Windows these days). From my Googling I could not find a standard Windows key combo, unfortunately.

With the other thing, I'm realizing that what I'm actually aiming for is the option for Profiles to take effect on hover instead of on active. I suppose this could be a Global setting, but my instinct is to suggest it be per-Profile (in case there are situations where a given user only wants certain Profiles to be active on hover). Or maybe you offer a Global, along with per-Profile overrides? (Edit: It could be a setting on the Default Profile, and subsequent Profiles could either inherit that or override it.) I'm hoping maybe this is possible, given that it seems you already can do some things based on Hover (eg, it looks like maybe you've added Activate on Hover to the Beta?), though of course I don't assume that means you will implement it. But this route (of Profile takes effect on Hover instead of waiting for Active) then just utilizes normal Profile stuff (ie, no weird changing Profiles mid-way like I previously posted). Though I have no idea if it would be crazy-hard to implement!

Since it seems you are implementing Activate on Hover (which I could already do via built-in Windows settings) that the reason I'm wanting this option for Profiles to take effect on Hover is that is provides more granular control than everything Activating on Hover (which I've had mixed experience with -- some things about it are very helpful, but it can be a bit buggy in other ways because of how the mouse jumps around and having windows activate when I don't truly want them to). My method allows me to still benefit from Hover aspects, but gives me more precise control of when I actually want to interact with another window (ie, send a chording combo to close or minimize the window).

Edit: I should also mention that this would negate my interest/need in a Window Minimize Send Keys option, as I could then just Hover and invoke my combo to Minimize the window I'm hovering over. I only need a Minimize Send Keys option so I can prepend Activate (to activate the window I'm hovering over before Minimizing it).

I will understand (though be bummed) if you decide it is not worth implementing and/or is too big of an technical feat to do so. :)
User avatar
phil
Site Admin
Posts: 7962
Joined: Sun Apr 06, 2003 11:12 pm

Re: Any Clever Methods of Activitating Window Under Mouse (prior to additional commands/functions)?

Post by phil »

Profiles should activate on hover by default (or at least as the mouse moves a little across the window).
There is a global setting to enable/disable that "Enable profile switching on mouse move" (that's been there pretty much since day 1 so >20 years) and a per profile option to disable it on a per profile basis which is more recent, I cant recall which version I added that, if it was in the 2.21 beta then you might not see it if your running 2.20.5 release. It does require the cursor to move at least a few pixels in any direction to trigger the "check again whats under the cursor" otherwise it takes too much CPU constantly checking.

As for minimize, it is possible from the button config dropdown, just not from simkeys which makes it useless for you as you need it as part of a macro/script. I can add it but that's going to take a while because it wont get in until 2.22 beta run, after I finally release 2.21 (I've promised I must get that out before adding new functionality as its been far too long already - I just haven't found the time to look at it for far too long - life and work getting in the way I'm afraid!).
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 11 x64 24H2, AMD Ryzen 9950x3D, MSI x870E Tomahawk, 64GB DDR%,
nVidia RTX 2070s (still lol)
mousetrap
New User
Posts: 9
Joined: Tue Oct 28, 2025 8:39 pm

Re: Any Clever Methods of Activitating Window Under Mouse (prior to additional commands/functions)?

Post by mousetrap »

Ah, I did not have that ("Enable profile switching on mouse move") enabled! I can't remember if I disabled it or what. But let me play with that a bit, as it might facilitate everything I need, in which case there'll be no need for a Minimize simkey (as I do already have the Minimize configured in the dropdown -- I just want to pass that through to windows under my mouse). Apologies for my not understanding what the setting does!

I'll experiment a bit and post back with how it's going!

Thank you so much!