Shut down Windows 11 with the middle button

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.
emiegna
New User
Posts: 5
Joined: Sun Jun 08, 2025 12:00 am

Shut down Windows 11 with the middle button

Post by emiegna »

Hi. I have Windows 11. I seem to remember that a while ago (with other previous versions of Windows) I could configure the middle mouse button to close the application I was using and, if I was on the Windows desktop, to shut down the computer. I'm referring to Alt + F4 (close). Currently, I have the mouse configured to do the same, but when I'm on the desktop and I click it, it doesn't shut down the computer. It doesn't do anything. I would like to configure the mouse to continue closing any application when I click the middle button and also shut down the computer directly if I'm on the desktop. For example, just like you do with a shortcut and the command shutdown.exe -s , which shuts down the computer directly.
User avatar
phil
Site Admin
Posts: 7890
Joined: Sun Apr 06, 2003 11:12 pm

Re: Shut down Windows 11 with the middle button

Post by phil »

I suspect this is a change in Windows 11 (possibly) - If I'm on the desktop and physically press ALT+F4 it brings up the shurdown dialog but does not actually action anything... But it may also be because at some point, "Close Window" was changes from just sending ALT+F4 keys to using the API CloseWIndow() so maybe that behaves differently. You could try simulated keystrokes instead and {alt}{f4} to force it to use the keycombo?
--[ 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)
emiegna
New User
Posts: 5
Joined: Sun Jun 08, 2025 12:00 am

Re: Shut down Windows 11 with the middle button

Post by emiegna »

I've managed to do something. I've configured the middle button as {ALT}{F4}, and when I click on any open application, it closes the application. When I click on the desktop, the "Shut Down Windows" window appears with the "Shut Down" option, which is the one I usually have selected. At the bottom of the window, three buttons appear: "OK," "Cancel," and "Help." When I click on the desktop, Windows doesn't shut down, but this window does appear. I've tried configuring the middle button by adding other elements to {ALT}{F4}. For example, {PRESS}Enter or {PRESS}Return. Neither simulates pressing the "OK" button in the Windows shutdown window. Any solution, please?
User avatar
phil
Site Admin
Posts: 7890
Joined: Sun Apr 06, 2003 11:12 pm

Re: Shut down Windows 11 with the middle button

Post by phil »

You dont want to use {PRESS} anything.. that presses, but does not release the key. and ENTER/RETURN needs to be in {}
like {ENTER}
{ALT}{F4}{ENTER} might work BUT it might cause problems not on the shutdown screen (like pressing enter in the next foreground application after the window closes). I don't think there is any other "shutdown" type of command though so it might be the only option.
You might be able to create a separate profile for the shutdown dialog, and in the latest version you can auto-run a simkey sequence when the profile is activated (on the options tab) - that could potentially press enter when the shutdown window gets focus, maybe...

I'll just test it here and if it works I'll attach a profile for it (but you will need to make sure you run the beta version as its not in the last 2.20.5 release).
--[ 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)
User avatar
phil
Site Admin
Posts: 7890
Joined: Sun Apr 06, 2003 11:12 pm

Re: Shut down Windows 11 with the middle button

Post by phil »

Yes that worked (may need to move the mouse a little over the shutdown dialog for the profile to activate) and as I said, use the latest beta version.

Here is the profile I created:
Shutdown Dialog.xmbcs
You do not have the required permissions to view the files attached to this post.
--[ 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)
emiegna
New User
Posts: 5
Joined: Sun Jun 08, 2025 12:00 am

Re: Shut down Windows 11 with the middle button

Post by emiegna »

Thank you so much!! I'll try it. Is the beta version also translated into Spanish?
User avatar
phil
Site Admin
Posts: 7890
Joined: Sun Apr 06, 2003 11:12 pm

Re: Shut down Windows 11 with the middle button

Post by phil »

Yes but it may be missing translations for the newest GUI elements!!

I don’t think the Spanish language packs have been updated for a while now!
--[ 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)
emiegna
New User
Posts: 5
Joined: Sun Jun 08, 2025 12:00 am

Re: Shut down Windows 11 with the middle button

Post by emiegna »

I hope I'm explaining this correctly. The middle button has "Simulated Keys." Specifically: {ALT}{F4}. Under "Application/Window Profiles," "Default" and "Shutdown Dialog" appear enabled. I'm not sure exactly how to get {ALT}{F4} and "Shutdown Dialog" to work.
User avatar
phil
Site Admin
Posts: 7890
Joined: Sun Apr 06, 2003 11:12 pm

Re: Shut down Windows 11 with the middle button

Post by phil »

I sent you a profile above "Shutdown Dialog". It has NO button mappings and should only be relevant when the shutdown window is shown.
Its sole purpose is to execute the new "On Profile Activated" simkeys on the "options" tab (for which you need the latest beta).
When the profile activates (i.e. the shutdown window is shown and the mouse is over it) it should execute that simulated keystrokes (which is just {enter}) which should press the default (OK) button and shutdown the computer.

I tested it and it worked here (I did need to move the mouse cursor a little to ensure the profile activated - not sure how long it would take to activate if the mouse is not moved over the window)
--[ 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)
emiegna
New User
Posts: 5
Joined: Sun Jun 08, 2025 12:00 am

Re: Shut down Windows 11 with the middle button

Post by emiegna »

I'm so sorry. I think I understand you perfectly. I think I have everything correct. Just as you explained. But the profile isn't working for me. From what I can see, I can't attach images to show how I have it set up. But I insist, I think everything is as you say, and yet it's not working for me. Maybe I'm doing something wrong.