summaryrefslogtreecommitdiff
path: root/_windows/ahk/capslock.ahk
diff options
context:
space:
mode:
authorkkard2 <[email protected]>2023-07-09 11:45:23 +0200
committerkkard2 <[email protected]>2023-07-09 11:51:07 +0200
commit0d477e37a06bf9083f230c1b97ecdc81ce81fcc7 (patch)
treee364373ffc1611092cbeb185ee22cbc38f366bae /_windows/ahk/capslock.ahk
parentf335ca400ddcd8f9da7d16f92f442c3c6d999b07 (diff)
move elevator configuration to this repo (this joke is very unfunny)
Diffstat (limited to '_windows/ahk/capslock.ahk')
-rw-r--r--_windows/ahk/capslock.ahk113
1 files changed, 113 insertions, 0 deletions
diff --git a/_windows/ahk/capslock.ahk b/_windows/ahk/capslock.ahk
new file mode 100644
index 0000000..0fb67bb
--- /dev/null
+++ b/_windows/ahk/capslock.ahk
@@ -0,0 +1,113 @@
+#Requires AutoHotkey v2
+#SingleInstance Force
+
+CapsLockState := false
+HarpoonLastWindowIndex := 0
+
+HarpoonRun(winTitle) {
+ SetTitleMatchMode 2
+ DetectHiddenWindows false
+
+ windows := WinGetList(winTitle)
+
+ if windows.Length = 0 {
+ return
+ }
+
+ if WinActive(winTitle) {
+ global HarpoonLastWindowIndex := Mod((HarpoonLastWindowIndex + 1), windows.Length)
+ } else {
+ global HarpoonLastWindowIndex := 0
+ }
+
+ WinActivate windows[HarpoonLastWindowIndex + 1]
+}
+
+#HotIf GetKeyState("CapsLock", "P")
+\::{
+ global CapsLockState := not CapsLockState
+ SetCapsLockState CapsLockState
+}
+
+; vim motion
+h::Left
+j::Down
+k::Up
+l::Right
+
+y::^Left
+u::^Down
+i::^Up
+o::^Right
+
+n::Home
+m::PgDn
+,::PgUp
+.::End
+
+; vim motion w select
++h::+Left
++j::+Down
++k::+Up
++l::+Right
+
++y::^+Left
++u::^+Down
++i::^+Up
++o::^+Right
+
++n::+Home
++m::+PgDn
++,::+PgUp
++.::+End
+
+; harpoon
+`::HarpoonRun("ahk_exe WindowsTerminal.exe")
+1::HarpoonRun("ahk_exe Discord.exe")
+2::HarpoonRun("ahk_exe rider64.exe")
+3::HarpoonRun("ahk_exe msedge.exe")
+4::HarpoonRun("ahk_exe Element.exe")
+5::HarpoonRun("ahk_exe code.exe")
+e::HarpoonRun("ahk_class CabinetWClass")
+
+Esc::Run "taskmgr"
+
+; window manipulation
+!h::#Left
+!j::#Down
+!k::#Up
+!l::#Right
+
+!y::#+Left
+!u::#+Down
+!i::#+Up
+!o::#+Right
+
+; desktop switching
+!,::^#Left
+!m::^#Right
+
+q::Esc
+#HotIf
+
+CapsLock::{
+ KeyWait "CapsLock"
+ if A_ThisHotkey = "CapsLock" {
+ Send "{Escape}"
+ }
+}
+
+!CapsLock::{
+ return
+}
+^CapsLock::{
+ return
+}
+^!CapsLock::{
+ return
+}
++CapsLock::{
+ return
+}
+
+Esc::F13