[v2] ThisHotkey doc problems Topic is solved

Share your ideas as to how the documentation can be improved.
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

[v2] ThisHotkey doc problems

Post by safetycar » 24 Sep 2021, 11:00

I'll try to explain this in the order I found it:
Starting here, looking at A_ThisHotkey: https://lexikos.github.io/v2/docs/Variables.htm#h
In the first paragraph there's a link for "ThisHotkey" which links to: https://lexikos.github.io/v2/docs/Hotkeys.htm#HotBraces
The text there talks about a function, but it seems like that example has suffered changes and the function is no longer there. But I've seen that at the end of the same page there's some talk about that and there's an example with that variable ( https://lexikos.github.io/v2/docs/Hotkeys.htm#Function )

Summarizing:
- "ThisHotkey" link probably needs to point to the end of Hotkeys' page.
- And the description regarding the first example needs a bit of review.

swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: [v2] ThisHotkey doc problems

Post by swagfag » 24 Sep 2021, 11:29

the braces define the (in-ahk-code-unnamed) function. which has 1 (in-ahk-code-invisible) parameter. which is called ThisHotkey. in other words:

Code: Select all

q::{
    MsgBox ThisHotkey ; q
}

safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: [v2] ThisHotkey doc problems

Post by safetycar » 24 Sep 2021, 12:25

:shock: I'm not sure what to say.
I couldn't had understood that without your comment.

neogna2
Posts: 590
Joined: 15 Sep 2016, 15:44

Re: [v2] ThisHotkey doc problems

Post by neogna2 » 24 Sep 2021, 15:49

swagfag's example helps. Suggestion: change the current example
#n::Run "notepad"
to this two-liner
#n::Run "notepad"
#q::MsgBox(ThisHotkey) ;shows '#q'

And add ThisHotkey to the v2 doc index.

User avatar
Ragnar
Posts: 613
Joined: 30 Sep 2013, 15:25

Re: [v2] ThisHotkey doc problems  Topic is solved

Post by Ragnar » 26 Sep 2021, 07:24

Thanks for reporting. Changes added in PR #492.

Post Reply

Return to “Suggestions on Documentation Improvements”