hotstrings

Get help with using AutoHotkey and its commands and hotkeys
moszt
Posts: 2
Joined: 05 Aug 2020, 09:35

hotstrings

05 Aug 2020, 09:54

I was trying to make accents work on my English based keyboard, with hotstrings. I want to use it to type in Hungarian, so I need the á, é, í, ó, ő, ú, ű, ö, ü to work. This is my first attempt at writing a hotkey script, so I feel pretty lost.

In Hungarian, you never write two of the same vowels next to each other, so my first was this:

Code: Select all

#Hotstring;

:?*:aa:: 
SendInput á

:?*:ee:: 
SendInput é

:?*:ii:: 
SendInput í

:?*:oo:: 
SendInput ó

:?*:uu:: 
SendInput ú

:?*:ooo:: 
SendInput ö

:?*:uuu:: 
SendInput ü

:?*:oooo:: 
SendInput ő

:?*:uuuu:: 
SendInput ű
but It doesn't work with the double accented characters.
Can someone please help out a complete noob? I would forever be thankful.
gregster
Posts: 4917
Joined: 30 Sep 2013, 06:48

Re: hotstrings

05 Aug 2020, 09:59

Code: Select all

:?*:oooo:: 
SendInput ő
Return
works for me - make sure that you save your script in UTF-8 with BOM encoding.

Generally, you should close all multi-line hotstring and hotkey subroutines with a return, otherwise the code execution will fall through to following code.
(Alternatively, you could do a one-liner with the X option: :?*X:oooo::SendInput ő. Then, the return would be implicit.)

PS: not sure, what you are intending with #Hotstring; - it will throw an error.
moszt
Posts: 2
Joined: 05 Aug 2020, 09:35

Re: hotstrings

05 Aug 2020, 13:57

gregster wrote:
05 Aug 2020, 09:59

Code: Select all

:?*:oooo:: 
SendInput ő
Return
works for me - make sure that you save your script in UTF-8 with BOM encoding.

Generally, you should close all multi-line hotstring and hotkey subroutines with a return, otherwise the code execution will fall through to following code.
(Alternatively, you could do a one-liner with the X option: :?*X:oooo::SendInput ő. Then, the return would be implicit.)

PS: not sure, what you are intending with #Hotstring; - it will throw an error.
My problem is that after pushing the o twice it converts to ó and then if I push it onece more it is óo and than óó.
gregster
Posts: 4917
Joined: 30 Sep 2013, 06:48

Re: hotstrings

05 Aug 2020, 15:05

Either use an endcharacter or do something like this:

Code: Select all

#Inputlevel 2
:?*X:oo::SendInput ó
:?*X:uu::SendInput ú

#Inputlevel 1
:?*X:óo::SendInput ö
:?*X:úu::SendInput ü

#Inputlevel 0
:?*X:öo::SendInput ő
:?*X:üu::SendInput ű

Return to “Ask For Help”

Who is online

Users browsing this forum: Milenko and 34 guests