Because times to times, I need to translate text into different languages using special characters not present on the keyboard, like ı, ş, ñ, ğ.
I created a script with AutoHotKey, transforming the combination of ^ + ^ + s -> into ş, in the same way for the others characters.
The script is working fine, but only working if the character preceding the first ^ is a space or the first letter. For example, when typing ma^^n <- this will not transform my character, whereas ^^n <- will transform it.
Here is the script, I specify that I only learned this language when creating the script:
:*c:^^S::
SendUnicodeChar(0x015E)
Return
:*c:^^s::
SendUnicodeChar(0x015F)
Return
:*c:^^i::
SendUnicodeChar(0x131)
Return
:*c:^^I::
SendUnicodeChar(0x130)
Return
:*c:^^g::
SendUnicodeChar(0x011F)
Return
:*c:^^G::
SendUnicodeChar(0x011E)
Return
:*c:^^n::
SendUnicodeChar(0x00F1)
Return
:*c:^^N::
SendUnicodeChar(0x00D1)
Return
:*c:^^c::
SendUnicodeChar(0x00E7)
Return
:*c:^^C::
SendUnicodeChar(0x00C7)
Return
; Find the corresponding letter from the unicode
; and send the input back
SendUnicodeChar(charCode)
{
VarSetCapacity(ki, 28 * 2, 0)
EncodeInteger(&ki + 0, 1)
EncodeInteger(&ki + 6, charCode)
EncodeInteger(&ki + 8, 4)
EncodeInteger(&ki +28, 1)
EncodeInteger(&ki +34, charCode)
EncodeInteger(&ki +36, 4|2)
DllCall("SendInput", "UInt", 2, "UInt", &ki, "Int", 28)
}
EncodeInteger(ref, val)
{
DllCall("ntdll\RtlFillMemoryUlong", "Uint", ref, "Uint", 4, "Uint", val)
}
?to each hotstring's options, e.g.:?*c:^^S::SendUnicodeChar(0x015E). - MCLSend, {U+015E}can also be used instead ofSendUnicodeChar(0x015E)- analogous for the others - Cadoiz