Created
July 22, 2023 05:03
-
-
Save buzztaiki/9d854a22e005b3af2001b2d0bbd3353d to your computer and use it in GitHub Desktop.
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
#Requires AutoHotkey v2.0 | |
;; manual https://www.autohotkey.com/docs/v2/ | |
;; keylist: https://www.autohotkey.com/docs/v2/KeyList.htm | |
;; window management: https://www.autohotkey.com/docs/v2/howto/ManageWindows.htm | |
;; prefixes | |
;; # Win, ! Alt, ^ Ctrl, + Shift | |
;; & combination | |
;; <, > left, right modifier | |
;; * wildcard, fire the hotkey even if extra modifiers are being held down | |
; RAlt -> LAlt | |
;; RAlt::Alt does not work with single press | |
*RAlt:: Send "{Blind}{RAlt up}{LAlt Down}" | |
*RAlt Up:: Send "{Blind}{LAlt Up}" | |
; Laptop Special | |
;; https://www.autohotkey.com/docs/v2/KeyList.htm#SpecialKeys | |
;; \ -> RShift | |
;; ¥ -> Backspace | |
SC073::RShift | |
SC07D::BackSpace | |
SC070::RControl | |
#w::!F4 | |
#.::#^Right | |
#,::#^Left | |
; #1:: moveToVDesktop(1) | |
; #2:: moveToVDesktop(2) | |
; #3:: moveToVDesktop(3) | |
; #4:: moveToVDesktop(4) | |
; #5:: moveToVDesktop(5) | |
#m:: { | |
wid := WinGetID("A") | |
if WinGetMinMax(wid) == 1 { | |
WinRestore(wid) | |
} else { | |
WinMaximize(wid) | |
} | |
} | |
; functions | |
;; https://www.autohotkey.com/docs/v1/Language.htm | |
;; https://www.autohotkey.com/docs/v1/Functions.htm | |
;; https://www.autohotkey.com/docs/v1/Variables.htm#Operators | |
repeat(str, n) { | |
res := "" | |
loop n { | |
res .= str | |
} | |
return res | |
} | |
moveToVDesktop(n) { | |
Send "{Blind}" . repeat("#^{Left}", 10) . repeat("#^{Right}", n - 1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment