Hotstring() ignores remapped keys Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

Hotstring() ignores remapped keys

15 Mar 2018, 06:31

After running the following script

Code: Select all

q::x
Hotstring("::xx", "Roman number 20")
, entering qq correctly writes xx, but that isn't recognized as a hotstring. How can I achieve that?
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Hotstring() ignores remapped keys

15 Mar 2018, 06:38

for reference, normal hotstring syntax doesn't work either, so its not limited to just the new Hotstring() function:

Code: Select all

q::x
::xx::Roman
i'm not sure if you can chain these like this

User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: Hotstring() ignores remapped keys

15 Mar 2018, 06:51

guest3456 wrote:for reference, normal hotstring syntax doesn't work either
Yup, I assume that doesn't work because it's all done at compile time. (There may be priority issues; unfortunately I didn't see anything about that at Hotstrings and Auto-replace and Remapping Keys and Buttons.) But the beauty of Hotstring() is that it works at runtime, so I was hoping that should work.
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Hotstring() ignores remapped keys  Topic is solved

15 Mar 2018, 07:01

Micromegas wrote:
guest3456 wrote:for reference, normal hotstring syntax doesn't work either
Yup, I assume that doesn't work because it's all done at compile time. (There may be priority issues; unfortunately I didn't see anything about that at Hotstrings and Auto-replace and Remapping Keys and Buttons.) But the beauty of Hotstring() is that it works at runtime, so I was hoping that should work.
googling turns up this first result:
https://autohotkey.com/board/topic/9136 ... remapping/

so this works:

Code: Select all

#InputLevel 1
q::x
#InputLevel 0
::xx::Roman
it actually is mentioned on the remapping and hotstrings help pages:
https://autohotkey.com/docs/misc/Remap.htm
https://autohotkey.com/docs/Hotstrings.htm

but not the hotstring() func page:
https://autohotkey.com/docs/commands/Hotstring.htm

User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: Hotstring() ignores remapped keys

15 Mar 2018, 09:47

Cool, thanks a lot! I googled, too (well, that is, I DuckDuckWent) and didn't find that. What did you google for?
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Hotstring() ignores remapped keys

15 Mar 2018, 10:13

Micromegas wrote:Cool, thanks a lot! I googled, too (well, that is, I DuckDuckWent) and didn't find that. What did you google for?
"ahk remapping trigger hotstring"

User avatar
Micromegas
Posts: 260
Joined: 28 Apr 2015, 23:02
Location: Germany

Re: Hotstring() ignores remapped keys

15 Mar 2018, 10:36

Thanks, the word "trigger" did it. Now DuckDuckGo finds it, too.

BTW, that also finds this stackoverflow Q&A, which has a nice short explanation.

Oh, and the two docs pages do mention InputLevel, but not for the combination of remapping and hotstring, which was what I was looking for. So, it's one of those things that are obvious in hindsight.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 193 guests