Skip to content

Instantly share code, notes, and snippets.

@ZaWertun
Last active October 30, 2022 16:06
Show Gist options
  • Save ZaWertun/583669cb00a8f394db9a79eb2e6df18e to your computer and use it in GitHub Desktop.
Save ZaWertun/583669cb00a8f394db9a79eb2e6df18e to your computer and use it in GitHub Desktop.
AutoHotKey script to switch layouts with CapsLock key on Windows
#NoEnv
#SingleInstance force
SendMode Input
CapsLock::SwitchNextLayout()
+CapsLock::SetCapsLockState % !GetKeyState("CapsLock", "T")
;SetCapsLockState, AlwaysOff
SwitchNextLayout()
{
ControlGetFocus, ctl, A
SendMessage, 0x50, 2, 0, %ctl%, A ; WM_INPUTLANGCHANGEREQUEST, INPUTLANGCHANGE_FORWARD (0x2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment