Code: Select all
#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.
CapsLock::
KeyWait, CapsLock ; wait for Capslock to be released
KeyWait, CapsLock, D T0.2 ; and pressed again within 0.2 seconds
if ErrorLevel
return
else if (A_PriorKey = "CapsLock")
SetCapsLockState, % GetKeyState("CapsLock","T") ? "Off" : "On"
return
*CapsLock:: return ; This forces capslock into a modifying key.
#If, GetKeyState("CapsLock", "f") ;Your CapsLock hotkeys go below
{
Send {LShift down}
Send {LAlt down}
Send f
Send {LAlt up}
Send {LShift up}
}