1

I have this autohotkey script:

StringCaseSense, On
^'::
{
 Input, char, L1
   if char = a
      Send á
   else if char = A
      Send Á
   else if char = e
      Send é
   else if char = E
      Send É
   else if char = i
      Send í
   else if char = I
      Send Í
   else if char = o
      Send ó
   else if char = O
      Send Ó
   else if char = u
      Send ú
   else if char = U
      Send Ú
   else
      Send %char% ;ignores ctrl+' is if it isn't followed by any of aeioucyAEIOUCY
   return
}

However, when I press ctrl + ', then a (for example), it inserts á (with the upside down ¡). However, the script says it's supposed to insert an á. Why does it do this?

0

This may be a Unicode/UTF-8 issue and/or something else.

Trying looking up virtual key in the AHK help topics.

You can probably replace the characters you're trying to send with Unicode equivalents to fix this... i.e.,

Send {U+00FA}      ; Send ú

You can look for virtual key codes either in the key history of the script via the tray icon and then View menu, or just look up the Unicode number by running the windows charmap utility and the Unicode hex key will be shown in the bottom left.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.