Why the order matters here

Get help with using AutoHotkey and its commands and hotkeys
Arrivest
Posts: 16
Joined: 24 Nov 2017, 12:28

Why the order matters here

27 Dec 2017, 19:29

Hi, I have a question, when I did this:

Code: Select all

^=:: Send ^{=}
=::End
It worked as intended. However if I flip the order of these two lines, the ^= stops working and functions as ^{End}. So it seems the order counts, but I didn't find the reference in the help file about such ordering ?
Noesis
Posts: 299
Joined: 26 Apr 2014, 07:57

Re: Why the order matters here

28 Dec 2017, 00:56

I'd suspect it's due to the 2nd line, actually being a key remap as opposed to a single hotkey. If you changed it to be a hotkey so "=:: Send {End}" then the two keys would work despite order, but since it's in a remap syntax, "=::End" has an implied * prefix meaning it works regardless of modifier keys being held, and when that occurs, the keys are interpreted in order, so the hotkey with the ^ modifier, will work if it's encountered first, but if it's after, the *=:: hotkey (i.e. remap) takes precedence and ^=:: isn't evaluated.
Arrivest
Posts: 16
Joined: 24 Nov 2017, 12:28

Re: Why the order matters here

28 Dec 2017, 14:49

Thanks for your answer Noesis, is this how it's supposed to work? Is it in the documentation? Thanks!
Noesis
Posts: 299
Joined: 26 Apr 2014, 07:57

Re: Why the order matters here

29 Dec 2017, 00:58

Yeah, this is how it's supposed to work IMO, it's in the docs but it isn't something that jumps out at you. You need to understand the remap actually creates a duplicate hotkey, with regard to your code, and then that's where you find out about the order.

The remapping stuff is here: https://autohotkey.com/docs/misc/Remap.htm.
While the order part is explained with regard to hotkey variants (duplicates), here: https://www.autohotkey.com/docs/command ... tm#variant.

Return to “Ask For Help”

Who is online

Users browsing this forum: TAC109 and 40 guests