How Punto Switcher
Code:
; Translates selected text RU<>EN, cycles input language
; How Punto Switcher
Pause::Translate() ; Hotkey - Pause button
Translate()
{
Send ^{Left}
Send +{End}
Eng=qwertyuiop[]asdfghjkl;'zxcvbnm,.QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>
Rus=йцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ
Send ^{Ins} ; Copy selection to clipboard
ClipWait
r =
Loop, parse, clipboard
{
SendMessage, 0x50,, 0x4090409,, A ; Eng
p := InStr(Eng, A_LoopField, true)
if p > 0
r := r . SubStr(Rus, p, 1)
else
{
SendMessage, 0x50,, 0x4190419,, A ; Rus
p := InStr(Rus, A_LoopField, true)
if p > 0
r := r . SubStr(Eng, p, 1)
else
r := r . A_LoopField
}
}
PostMessage, 0x50, 2, 0,, A ; Switch lang to next
SendInput {Del}%r% ; Delete selection, print translated text
}
Популярная функция Punto Switcher заменитель ee.
