Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Can manage #HotIf expression like so:
- static existingHotIfExpression := "MouseIsOverControl(`"ahk_class Shell_TrayWnd`", `"iS)\QWindows.UI.Composition.DesktopWindowContentBridge1\E|MSTaskSwWClass1|MSTaskListWClass`")"
- HotIf(existingHotIfExpression), Hotkey("~*LButton", OpenCycledGroupWnd, "On") ; E.g. when you're disabling all ~*LButton hotkeys and need to turn this hotkey back on immediately
- Can also be done in regedit by right-clicking Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced and selecting New > DWORD (32-bit) Value.
- You’ll see that the new entry will appear on the right side, and you should name it LastActiveClick. Then, double-click this entry you just added and change Value data from 0 to 1.
- Click on OK to close that dialog box and restart your computer for the changes to take effect
- */
- #Requires AutoHotkey 2.0
- #NoTrayIcon
- A_KeyDelay := -1 ; For Send b/c it reverts to the Event SendMode when another AHK script installs a low-level keyboard hook
- ; https://www.autohotkey.com/docs/v2/misc/RegEx-QuickRef.htm (Regular Expressions [RegEx] - Quick Reference)
- ; ClassNN argument consists of three classes seperated by the | (OR) symbol, the first two for W11 and the third one for W10 (can be seen by using WinSpy++ on the app section in taskbar)
- #HotIf MouseIsOverControl("ahk_class Shell_TrayWnd", "iS)\QWindows.UI.Composition.DesktopWindowContentBridge1\E|MSTaskSwWClass1|MSTaskListWClass")
- ~*LButton::OpenCycledGroupWnd(*) => (Send("{Blind+!#}{Ctrl down}"), KeyWait("LButton"), Send("{Blind+!#}{Ctrl up}"))
- MouseIsOverControl(winTitle, classNN)
- {
- try return (MouseGetPos(,, &winId, &control), WinExist(winTitle " ahk_id " winId) && control ~= classNN)
- return false
- }
Advertisement
Comments
-
- I wonder if it can be improved, making it actually open the latest active wnd
- because Ctrl+Click merely cycles through windows of a specific app, it doesn't care which one was active last
- the only way I can think of is hooking the foreground event, temporarily making the wnd invisible
- and then checking if it's the latest active wnd, if not then cycle through until it's the right one
-
- I heard from Nikola that it opens the latest active wnd on W11 all the time, so must be a W10 issue
Add Comment
Please, Sign In to add comment
Advertisement