Skip to content

Instantly share code, notes, and snippets.

@kumekay
Last active October 11, 2024 20:57
Show Gist options
  • Save kumekay/fc1b221f6eee49d0f7f7e9f36bbd56ea to your computer and use it in GitHub Desktop.
Save kumekay/fc1b221f6eee49d0f7f7e9f36bbd56ea to your computer and use it in GitHub Desktop.
AutoHotkey srcipt for mac-like shortcuts I use on crabapplepad.
#Requires AutoHotkey v2.0
; Mainly from: https://gist.github.com/ascendbruce/677c3169259c975259045f905cd889d6?permalink_comment_id=5182071#gistcomment-5182071
; #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.
; Docs:
; https://autohotkey.com/docs/Hotkeys.htm
; https://autohotkey.com/docs/KeyList.htm
; Ref https://autohotkey.com/board/topic/60675-osx-style-command-keys-in-windows/
; You need to disable "Between input languages" shotcut from Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys
; Block single press on Alt so it doesn't trigger app menu
~Alt:: Send "{Blind}{vkE8}"
; Universal shotcuts
$#x:: Send "^x"
$#c:: Send "^c"
$#s:: Send "^s"
$#v:: Send "^v"
$#a:: Send "^a"
$#z:: Send "^z"
$#+z:: Send "^y"
$#w:: Send "^w"
$#f:: Send "^f"
$#n:: Send "^n"
$#q:: Send "!{f4}"
$#r:: Send "^{f5}"
$#m:: Send "{LWin Down}{Down}{LWin Up}"
$#`:: Send "{Alt Down}{Shift Down}{Tab}{Shift Up}"
; Quick Switch Tab shotcuts
$#1:: Send "^1"
$#2:: Send "^2"
$#3:: Send "^3"
$#4:: Send "^4"
$#5:: Send "^5"
$#6:: Send "^6"
$#7:: Send "^7"
$#8:: Send "^8"
$#9:: Send "^9"
$#0:: Send "^0"
; Chrome shotcuts
$#t:: Send "^t"
$#+t:: Send "^+t"
$#+]:: Send "{Ctrl Down}{Tab Down}{Tab Up}{Ctrl Up}"
$#+[:: Send "{Ctrl Down}{Shift Down}{Tab Down}{Tab Up}{Shift Up}{Ctrl Up}"
$#l:: Send "^l"
; input methods
$+,:: Send "^,"
$+.:: Send "^."
; Using CapsLock to switch languages, see https://superuser.com/questions/429930/using-capslock-to-switch-the-keyboard-language-layout-on-windows-7
; Uncomment the section below
SetCapsLockState('AlwaysOff')
+CapsLock:: {
if (GetKeyState("CapsLock", "T")) {
SetCapsLockState('Off')
} else {
SetCapsLockState('On')
}
}
CapsLock:: Send("{Shift down}{Alt down}{Shift up}{Alt up}")
; navigation, selection, delete a word/till end
#HotIf !WinActive("Task Switching") ; disable it when swtitching between windows
$#Left:: Send "{Home}"
$#Right:: Send "{End}"
$#Up:: Send "{Lctrl down}{Home}{Lctrl up}"
$#Down:: Send "{Lctrl down}{End}{Lctrl up}"
#HotIf
$#Left:: Send "{ctrl down}{Left}{ctrl up}"
$#Right:: Send "{ctrl down}{Right}{ctrl up}"
$#+Left:: Send "{ctrl down}{shift down}{Left}{shift up}{ctrl up}"
$#+Right:: Send "{ctrl down}{shift down}{Right}{shift up}{ctrl up}"
; $#+Left:: Send "{shift down}{Home}{shift up}"
; $#+Right:: Send "{shift down}{End}{shift up}"
; $#+Up:: Send "{Ctrl Down}{shift down}{Home}{shift up}{Ctrl Up}"
; $#+Down:: Send "{Ctrl Down}{shift down}{End}{shift up}{Ctrl Up}"
; !BS:: Send "{LShift down}{Home}{LShift Up}{Del}"
; #BS:: Send "{LCtrl down}{BS}{LCtrl up}"
; $#Space:: Send "{Ctrl Down}{LWin Down}{Space}{LWin Up}{Ctrl Up}"
; Prevent Win key from launching start menu
~LWin:: Send "{Blind}{vkE8}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment