Skip to content

Instantly share code, notes, and snippets.

@abakum
Created October 16, 2023 09:13
Show Gist options
  • Save abakum/7bcf67d4969470ff3c7611737b39f489 to your computer and use it in GitHub Desktop.
Save abakum/7bcf67d4969470ff3c7611737b39f489 to your computer and use it in GitHub Desktop.
Another global keyboard layout switch by clicking the left or right Ctrl key
;EnRu.ahk
;Another global keyboard layout switch by clicking the left or right Ctrl key
;Еще один глобальный переключатель раскладки клавиатуры щелчком левой или правой клавиши Ctrl
en:=0x4090409
ru:=0x4190419
WM_INPUTLANGCHANGEREQUEST:=0x0050
HWND_BROADCAST:=0xFFFF
Frequency:=523
~LControl up:: ;en
{
if (A_PriorKey = "LControl")
{
PostMessage WM_INPUTLANGCHANGEREQUEST,,en,, HWND_BROADCAST
SoundBeep Frequency
}
}
~RControl up:: ;ru
{
if (A_PriorKey = "RControl")
{
PostMessage WM_INPUTLANGCHANGEREQUEST,,ru,, HWND_BROADCAST
SoundBeep Frequency*2
}
}
@abakum
Copy link
Author

abakum commented Oct 23, 2023

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