Func InvertLanguage($sString)
Local $bEnglish[47] = [')', '!', '@', '#', '$', '%', '^', '&', '*', '(', 'A', "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", ":", "+", "<", "_", ">", "?", "~", "{", "|", "}", '"']
Local $sEnglish[47] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", ";", "=", ",", "-", ".", "/", "`", "[", "\", "]", "'"]
Local $bRussian[47] = [')', '!', '"', '№', ';', '%', ' ', '?', '*', '(', 'Ф', "И", "С", "В", "У", "А", "П", "Р", "Ш", "О", "Л", "Д", "Ь", "Т", "Щ", "З", "Й", "К", "Ы", "Е", "Г", "М", "Ц", "Ч", "Н", "Я", "Ж", "+", "Б", "_", "Ю", ",", "Ё", "Х", "/", "Ъ", "Э"]
Local $sRussian[47] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'ф', "и", "с", "в", "у", "а", "п", "р", "ш", "о", "л", "д", "ь", "т", "щ", "з", "й", "к", "ы", "е", "г", "м", "ц", "ч", "н", "я", "ж", "=", "б", "-", "ю", ".", "ё", "х", "\", "ъ", "э"]
Local $sResult, $sCompare
For $i = 0 To StringLen($sString)
$sSymbol = Asc(StringMid($sString, $i, 1))
For $y = 0 To 46
$hWin = WinGetHandle('[ACTIVE]')
$iLayout = _WinAPI_GetKeyboardLayout($hWin)
If Asc($bEnglish[$y]) = $sSymbol Then
if $iLayout = "0x04090409" Then
sleep(100)
Send($bEnglish[$y])
ExitLoop
Else
_WinAPI_SetKeyboardLayout ($hWin , 0x0409)
sleep(100)
WinActivate($hWin)
Send($bEnglish[$y])
ExitLoop
EndIf
EndIf
If Asc($sEnglish[$y]) = $sSymbol Then
if $iLayout = "0x04090409" Then
sleep(100)
Send($sEnglish[$y])
ExitLoop
Else
_WinAPI_SetKeyboardLayout ($hWin , 0x0409)
sleep(100)
WinActivate($hWin)
Send($sEnglish[$y])
ExitLoop
EndIf
EndIf
If Asc($bRussian[$y]) = $sSymbol Then
if $iLayout = "0x04190419" Then
sleep(100)
Send($bRussian[$y])
Else
_WinAPI_SetKeyboardLayout ($hWin , 0x0419)
sleep(100)
WinActivate($hWin)
Send($bRussian[$y])
EndIf
EndIf
If Asc($sRussian[$y]) = $sSymbol Then
if $iLayout = "0x04190419" Then
sleep(100)
Send($sRussian[$y])
Else
_WinAPI_SetKeyboardLayout ($hWin , 0x0419)
sleep(100)
WinActivate($hWin)
Send($sRussian[$y])
EndIf
EndIf
Next
Next
EndFunc