Skip to content

Instantly share code, notes, and snippets.

@userhooke
Created March 28, 2019 09:55
Show Gist options
  • Save userhooke/0a4538bdc9567718df5504a3549efe2e to your computer and use it in GitHub Desktop.
Save userhooke/0a4538bdc9567718df5504a3549efe2e to your computer and use it in GitHub Desktop.
AHK > Switch input language by pressing CapsLock
; Path to startup folder Windows 10 = C:\Users\${user.name}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
#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.
SetCapsLockState, AlwaysOff
CapsLock::Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}
@GavukaAlexandr
Copy link

I have made some minor changes to the syntax for AutoHotkey v2.0

SendMode("Input") ; Sets the sending method to the "Input" mode.
SetWorkingDir A_ScriptDir ; Ensures a consistent starting directory.
SetCapsLockState "AlwaysOff"
CapsLock::Send "{Alt Down}{Shift Down}{Shift Up}{Alt Up}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment