Created
November 17, 2015 13:06
-
-
Save alexmorozov/48e8bf90fa85cab909c8 to your computer and use it in GitHub Desktop.
Bind windows to hotkeys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Map windows to 1-0 with ctrl+win+<num>, switch with alt+<num> | |
Loop 10 | |
{ | |
i := A_Index - 1 | |
HotKey #^%i%,DynHotkey | |
HotKey !%i%, DynHotkey | |
} | |
Exit | |
DynHotkey: | |
StringRight i, A_ThisHotKey, 1 | |
StringMid what,A_ThisHotKey, 2, 1 | |
var := var%i% | |
IfEqual what, ^, WinGet var%i%, ID, A ; Save ID | |
WinActivate ahk_id %var% ; Switch | |
Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment