-
Notifications
You must be signed in to change notification settings - Fork 6
Description
I made a few minor changes to the Window Switcher script to make it compatible with alternative hotkeys, such as [Win] + [Tab], [Win] + [Caps Lock], [Alt] + [W] and [Win] + [S].
Part 1
test ; !+Tab:: { ; FilteredWindowSwitcher() ; } ;!Tab:: { ; FilteredWindowSwitcher() ;}
; [Win] + [Tab] and [Win] + [Capslock] ; ModifierKey := "LWin" ; TabKeyForward := "Tab" ; TabKeyBackward := "Capslock"
; [Alt] + [w] and [Win] + [s] ModifierKey := "LAlt" TabKeyForward := "w" TabKeyBackward := "s" Hotkey(ModifierKey . " & " . TabKeyForward, FilteredWindowSwitcher, "On") Hotkey(ModifierKey . " & " . TabKeyBackward, FilteredWindowSwitcher, "On")
Part 2
FilteredWindowSwitcher(*) { global TaskbarListInitialized, TempHiddenWindows if TempHiddenWindows.Length { ; Needs #MaxThreadsPerHotkey 2 to handle Alt+++... to tab through windows with , while waiting for Alt to be released If (InStr(A_ThisHotkey, TabKeyBackward) && TabKeyBackward != TabKeyForward) Send "{LShift Down}" else Send "{LShift Up}" Send "{Blind}{Tab}" return }
Part 3
If (InStr(A_ThisHotkey, TabKeyBackward) && TabKeyBackward != TabKeyForward) Send "{LShift Down}" Send "{LAlt Down}" Send "{Blind}{Tab}" ; Tab or Shift+Tab to go in reverse KeyWait(ModifierKey) ; MakeSplash("Window Switcher", "Alt (physical key) released", 1000) for Window in TempHiddenWindows {
Part 4
TempHiddenWindows.Length := 0 ; MakeSplash("Window Switcher", "Closing switcher (triggering logical release of Alt)", 1000) Send "{LAlt Up}" ; This could be earlier, couldn't it? ; MakeSplash("Window Switcher", "Switcher closed.", 1000) If (InStr(A_ThisHotkey, TabKeyBackward) && TabKeyBackward != TabKeyForward) Send "{LShift Up}"
This works quite well, and others will benefit from it too. Could you consider incorporating it?
I would like to see the same flexibility in the app switcher. I hope there's a chance.