dotfiles/win/win.ahk

113 lines
3.2 KiB
AutoHotkey
Raw Normal View History

2021-01-29 15:32:21 +00:00
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Mouse, Screen ; mouse coordinates relative to the screen
; =========================
2021-07-08 08:16:21 +00:00
; DEBUGGING
2021-01-29 15:32:21 +00:00
; =========================
2021-07-08 08:16:21 +00:00
global DEBUGGING := false
ToggleDebugging() {
global DEBUGGING
DEBUGGING := not DEBUGGING
}
LogDebug(msg) {
global DEBUGGING
if (not DEBUGGING) {
return
}
FormatTIme, now, , MM-dd HH:mm:ss
log := FileOpen("d:\win.ahk.log", "a")
log.WriteLine(Format("[{1}] {2}", now, msg))
log.Close()
}
2021-01-29 15:32:21 +00:00
; =========================
2021-07-08 08:16:21 +00:00
; LIBS
2021-01-29 15:32:21 +00:00
; =========================
2021-07-08 08:16:21 +00:00
InitWindowManager()
InitClipboardManager()
#Include, ahk\JSON.ahk
#Include, ahk\WinGetPosEx.ahk
#Include, ahk\WindowManager.ahk
#Include, ahk\ClipboardManager.ahk
; =========================
; KEY BINDINGS
; =========================
; Super + Shift + r => Reload ahk
#+r::Reload
; Ctrl + ESC => Ctrl+`
2020-05-10 07:20:40 +00:00
^Esc:: Send ^{``}
2021-07-08 08:16:21 +00:00
; Win + q => Close window
#q:: !F4
; Ctrl+ backspace => Delete all text
2020-05-10 07:20:40 +00:00
^BS::
2021-07-08 08:16:21 +00:00
Send ^a
Send {BS}
return
; Win + = => Increase Volume
2021-07-01 14:16:25 +00:00
#=::SoundSet, +5
2021-07-08 08:16:21 +00:00
; Win + - => Decrease volume
2021-07-01 14:16:25 +00:00
#-::SoundSet, -5
2021-07-08 08:16:21 +00:00
; Win + \ => Toggle mute
2021-07-01 14:16:25 +00:00
#\::Send {Volume_Mute}
2021-07-08 08:16:21 +00:00
; Win + backspace => Lock
#BS::#l
2021-07-08 08:16:21 +00:00
; WINDOW MANAGER
; Win + f => Toggle window maximum
2021-01-29 15:32:21 +00:00
#f:: ToggleActiveWinMaximum()
2021-07-08 08:16:21 +00:00
; Win + j => Focus right window
2021-01-29 15:32:21 +00:00
#j:: FocusWinByDirection("right")
2021-07-08 08:16:21 +00:00
; Win + k => Focus left window
2021-01-29 15:32:21 +00:00
#k:: FocusWinByDirection("left")
2021-07-08 08:16:21 +00:00
; Win + Shift + j => Move active window to right side
2021-01-29 15:32:21 +00:00
#+j::MoveActiveWinByDirection("right")
2021-07-08 08:16:21 +00:00
; Win + Shift + k => Move active window to left side
2021-01-29 15:32:21 +00:00
#+k::MoveActiveWinByDirection("left")
2021-07-08 08:16:21 +00:00
; Win + Shift + b => Blacklist active window so it won't be arranged when launched
#+b::BlacklistArrangementForActiveWindow()
; Win + Shift + b => Whitelist active window so it always be arranged when launched
#+w::WhitelistArrangementForActiveWindow()
; Win + Shift + i => Remove active window from Blacklist/Whitelist
#+i::IgnoreArrangementForActiveWindow()
; Win + Shift + d => Toggle debug logging
#+d::ToggleDebugging()
2020-05-10 07:20:40 +00:00
2021-07-08 08:16:21 +00:00
; CLIPBOARD MANAGER
#c::AlternativeCopy()
#v::AlternativePaste()
2020-05-10 07:20:40 +00:00
2021-01-29 15:32:21 +00:00
; CAPSLOCK AS HYBRID KEY
; Capslock & h:: Send {Left}
; Capslock & j:: Send {Down}
; Capslock & k:: Send {Up}
; Capslock & l:: Send {Right}
; Capslock & y:: Send {Browser_Back}
; Capslock & u:: Send ^{PgUp}
; Capslock & i:: Send ^{PgDn}
; Capslock & o:: Send {Browser_Forward}
; Capslock & BackSpace:: Send {Del}
; Capslock & n:: Send {Home}
; Capslock & m:: Send {PgUp}
; Capslock & ,:: Send {PgDn}
; Capslock & .:: Send {End}
2021-07-01 14:16:25 +00:00
; Capslock & Space:: SetCapsLockState % !GetKeyState("CapsLock", "T")
; +CapsLock::
; Send {~}
; SetCapsLockState % !GetKeyState("CapsLock", "T")
; Return
; Capslock::return