Skip to content

Instantly share code, notes, and snippets.

@kdankov
Created March 22, 2020 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdankov/b7b2795634d4d0c4f703458a44783ce3 to your computer and use it in GitHub Desktop.
Save kdankov/b7b2795634d4d0c4f703458a44783ce3 to your computer and use it in GitHub Desktop.
Windows Keyboard Mapping Fixes
#SingleInstance force
/*
#InstallKeybdHook
$VKE2::Send, {``}
$+VKE2::Send, {~}
$VKC0::Send, {\}
$+VKC0::Send, {|}
Top Left Tilde Codes
VKC0
SC029
Bottom Left Tilde Codes
VKE2
SC056
Ю
ю
Ч
ч
*/
LAlt & VKC0::Send, {Alt Down}{Shift Down}{Shift Up}{Alt Up}
$VKE2::
LangID := % DllCall("GetKeyboardLayout", Int,DllCall("GetWindowThreadProcessId", int,WinActive("A"), Int,0))
if ( LangID = -256965630 )
{
Send, {ч}
}
else if ( LangID = 67699721 )
{
Send, {``}
}
else
{
MsgBox % LangID
}
return
$+VKE2::
LangID := % DllCall("GetKeyboardLayout", Int,DllCall("GetWindowThreadProcessId", int,WinActive("A"), Int,0))
if ( LangID = -256965630 )
{
Send, {Ч}
}
else if ( LangID = 67699721 )
{
Send, {~}
}
else
{
MsgBox % LangID
}
return
$VKC0::
LangID := % DllCall("GetKeyboardLayout", Int,DllCall("GetWindowThreadProcessId", int,WinActive("A"), Int,0))
if ( LangID = -256965630 )
{
Send, {ю}
}
else if ( LangID = 67699721 )
{
Send, {\}
}
else
{
MsgBox % LangID
}
return
$+VKC0::
LangID := % DllCall("GetKeyboardLayout", Int,DllCall("GetWindowThreadProcessId", int,WinActive("A"), Int,0))
if ( LangID = -256965630 )
{
Send, {Ю}
}
else if ( LangID = 67699721 )
{
Send, {|}
}
else
{
MsgBox % LangID
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment