将 Caps 按键转为 Ctrl + Space 模仿 Mac 中英文切换
#Requires AutoHotkey v2.0 CapsLock::{ if KeyWait("CapsLock", 0.45) ; 等待 0.45 秒,返回 true 表示短按 Send "^ " ; 发送 Ctrl + Space else { global t := !t SetCapsLockState(t ? "On" : "Off") } KeyWait("CapsLock") ; 等待 CapsLock 松开,防止重复触发 }
交换 Ctrl 和 Alt
#Requires AutoHotkey v2.0 ; 左 Ctrl -> 左 Alt LCtrl::{ Send("{LAlt Down}") KeyWait("LCtrl") Send("{LAlt Up}") return } ; 左 Alt -> 左 Ctrl LAlt::{ Send("{LCtrl Down}") KeyWait("LAlt") Send("{LCtrl Up}") return }