Hotkey Help - Display Active AHK Hotkeys and Hotstrings

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

14 Jan 2019, 14:23

zhaowu wrote:
14 Jan 2019, 09:21
Wigi wrote:
04 Jan 2019, 20:30
Many thanks, this last update (2019 01 03) indeed identifies the square key and Shift-square key, that I use in 4 hotkeys:

01.png
Thanks for sharing this little useful tool. :D

This reply is to post a bug and solution concerning duplicate entries. Somehow, each entry displays twice for #include files. I do not fully understand the code, so I just add U option to remove duplicates in each sort as below.

Code: Select all

Sort, Display_Section, U
I have tested with hotkeys defined in an #include file and did not end up with duplicate entries.

I was able to replicate this behavior by having an #include file include itself but that seems more like the wrong use of #include. And in that case the hotkey really is in the script twice.

Now if the code actually defines the same hotkey twice that is a different matter. You can have the same hotkey defined twice, usually using the #if command but you can have one hotkey override another hotkey.

The problem with just eliminating all duplicates is that sometimes you really do have duplicates that need to be displayed. For example I personally have F12 defined four times. Each hotkey does a different thing depending on what is active at the moment. It is my go-to context sensitive hotkey.

Can you post code that creates duplicate entries?

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

14 Jan 2019, 14:29

r2997790 wrote:
14 Jan 2019, 09:57
So looking forward to the multiple line hotstring implementation if you can wrangle the RegEx to do it FantasticGuru --- it will help me clean up my messy hotstrings files enormously.

Such a useful and clever bit of scripting.

My testing works on multi-line hotstrings.

Code: Select all

::btw::	; <-- By The Way
	MsgBox You typed "btw".
return
This produces the Help entry I would expect.

Can you post an example of a multi-line hotstring that is not caught by Hotkey Help?

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
r2997790
Posts: 71
Joined: 02 Feb 2017, 02:46

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

16 Jan 2019, 01:56

FanaticGuru wrote:
14 Jan 2019, 14:29
Can you post an example of a multi-line hotstring that is not caught by Hotkey Help?
FG, here's an example of a multi-line hotstring, which doesn't get parsed for me:

Code: Select all

::bwfg::
(
Best Wishes,
FantasticGuru
)
This returns:

Code: Select all

<HS>  bwfg               = 
Could the code be adapted to allow multi-line hotstrings like this to be parsed?
dathan_neal
Posts: 7
Joined: 19 Apr 2019, 13:16

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

19 Apr 2019, 13:20

Thank you! New to AHK and this tool is exactly what I was hoping for. Now to just see if I can get these hotkeys to respond a little quicker....
nichatr
Posts: 7
Joined: 17 May 2019, 01:43
Contact:

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

17 May 2019, 01:49

Excellent utility. It is what I wanted for my autohotkey main script. Thank you very much!
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help Display Active AHK Hotkeys and Hotstrings

18 May 2019, 18:27

ArcherHak wrote:
18 May 2019, 07:42
Kudos

Thanks for that but surely there is a way to create a custom button and script that effectively simulates Ctrl P - so one can go in one step to the Print options box?

V

There is not currently an option to print althought you can hit Win+Alt+F1 to bring up the settings dialog where you can then export to a text file. Then you could print the text file manually.

Printing is a complex task due to the wide range of possible printers and drives. It is not something you normally see directly form AutoHotkey.

The easiest approach is passing the task off to another program in Windows.

Could use something like: Run, print "My File.txt",, HIDE to print a file from the Windows default word processor using the default printer and settings. If you want to pick printers and such then all AutoHotkey can do easily is open the word processor for you.

Not sure if it is worth the effort adding a Ctrl-P shortcut to print if all it does is open the Help dialog in Notepad.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
User avatar
tdalon
Posts: 40
Joined: 21 Apr 2017, 07:19
Location: Germany
Contact:

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

07 Jun 2019, 02:53

This is great! Many thanks for sharing
I have two wishes:
- Support for clickable link - for the usecase that you want to link for a detailed user documentation and be able to open the link right from the GUI
- Possibility to add line between hotkeys to be displayed in the GUI to mark for example for which application the hotkey is defined
My script is built like this:
; All Applications
#ifWinActive,ahk_group Explorer
... here some hotkeys defined
#IfWinActive,ahk_group Browser
... here some other hotkeys

And I would like in the GUI to have some separator line/comment for each application scope.

Maybe one could add a special keyword to be parsed by Hotkey Help for this
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

07 Jun 2019, 13:34

tdalon wrote:
07 Jun 2019, 02:53
This is great! Many thanks for sharing
I have two wishes:
- Support for clickable link - for the usecase that you want to link for a detailed user documentation and be able to open the link right from the GUI
- Possibility to add line between hotkeys to be displayed in the GUI to mark for example for which application the hotkey is defined
My script is built like this:
; All Applications
#ifWinActive,ahk_group Explorer
... here some hotkeys defined
#IfWinActive,ahk_group Browser
... here some other hotkeys

And I would like in the GUI to have some separator line/comment for each application scope.

Maybe one could add a special keyword to be parsed by Hotkey Help for this
Here is how I handle scope:

Code: Select all

================================ SHORTCUTS =================================
Win+Alt+S Up            <-- (Adobe Acrobat) : PDF Secure
Win+Ctrl+S Up           <-- (Adobe Acrobat) : PDF Unsecure
Win+V                   <-- (Adobe Acrobat) : Set Properties (Page Only, Single Page, Fit Page)
F12                     <-- (Excel) : Fill Active Cell - *No Fill*
F8                      <-- (Excel) : Fill Active Cell - Cycle Standard Colors
Ctrl+F9                 <-- (Excel) : Fill Active Cell - Dark Red
Ctrl+F11                <-- (Excel) : Fill Active Cell - Green
F11                     <-- (Excel) : Fill Active Cell - Light Green
Ctrl+F10                <-- (Excel) : Fill Active Cell - Orange
F9                      <-- (Excel) : Fill Active Cell - Red
F10                     <-- (Excel) : Fill Active Cell - Yellow
Ctrl+F12                <-- (Excel) : Hide Columns
Alt+F12                 <-- (Excel) : Hide Rows
Shift+F12               <-- (Excel) : Unhide Range / All
Shift+Tab               <-- (OneNote) : Insert Tab with /t
Win+J                   <-- (Outlook) : Junk / Block Sender
Win+Ctrl+E              <-- File Explorer : Open @ Documents
Win+Ctrl+Alt+E          <-- File Explorer : Open @ Pictures
Win+T                   <-- Outlook : New Task
Win+Ctrl+T              <-- Outlook : Open Tasks
If the hotkey is specific to an app then I put it at the first of the comment with a colon. If the app name is in () it means it must be the active window.

Separator lines or banners are problematic because of sorting. Grouping things under group headings is tricky when sorting. This is logistically difficult. I basically group things by manipulating the sort order with special characters like (~* etc.

As far as links, I assume you are talking about a URL hyperlink. That is somewhat doable. There are two ways. One is to make the GUI an ActiveX control which accepts html code. I am not sure of the ramifications of that. It could be good as it would allow all kinds of html formatting. It would require quite a bit of testing as this would be a far reaching code change with could have some unexpected consequences. The other is some AHK trickery to determine where you click in an Gui and handle it more manually by AHK. I will look in to it when I have some time.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
nichatr
Posts: 7
Joined: 17 May 2019, 01:43
Contact:

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

29 Feb 2020, 01:06

Very useful script for keeping track my hotkeys and thanks a lot!
I've noticed that if I put my hotkeys in a separate AHK file and #include them from the main script then all hotkeys are shown double.
Is there a work around?
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

06 Mar 2020, 18:47

nichatr wrote:
29 Feb 2020, 01:06
I've noticed that if I put my hotkeys in a separate AHK file and #include them from the main script then all hotkeys are shown double.
Is there a work around?

I do not experience this problem.

If I make a script "Test.ahk"

Code: Select all

+p::
	MsgBox Shift P
return
Then another script "Test2.ahk"

Code: Select all

#include Test.ahk

^p::
	MsgBox Control P
return
Then I run "Test2.ahk".

I get 1 entry for each hotkey within the Hotkey Help dialog as would be expected.

Is it possible that you are actually creating hotkeys twice? Autohotkey will probably not care as one creation will just overwrite a previous creation but Hotkey Help will view it as two hotkeys created and display it as such. This is because it is possible to create the exact same hotkey trigger just with context-sensitive #if commands that control when they are active.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
nichatr
Posts: 7
Joined: 17 May 2019, 01:43
Contact:

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

07 Mar 2020, 09:24

Thanks for the reply, I'll check it.
BlueHornet
Posts: 1
Joined: 01 May 2018, 09:19

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

17 Jul 2020, 05:08

This is really wonderful. My hat's off to you, FG. I had been looking for this utility for a long time, and I'm glad I finally found it earlier this week.

Since there isn't enough room to display it all adequately on my 13" monitor and it can't scroll up to enable me to click the "Finish" button ... I did make one small change to the Create Setting GUI, where I changed all of the yp+35 values to yp+30 so that the settings box would fit fully and properly on the small laptop screen. I feel proud as hell of myself that I was able to find and modify that and not blow up the whole script. (I don't know if it would make any sense to make that an additional setting, if some users require more or even less spacing, but yp+30 made a perfectly viewable GUI for my purposes.)

I would have written to thank you sooner, but I've spent most of my free time this week modifying the comments in my many AHK scripts to more properly display with this wonderful tool. I feel like I'm just getting started in AHK again ... and I've been using it for years!

Thanks very much, FG.
tnkrer
Posts: 1
Joined: 18 Jul 2020, 16:27

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

18 Jul 2020, 16:52

Either this is not working for me or I am missing something.

I have a startup script - (copy of AHK Startup) which has a few scripts in the Join section. One of which is Hotkey Help
This is how that section looks

Code: Select all

Files := [	; Additional Startup Files and Folders Can Be Added Between the ( Continuations  ) Below
(Join, 
"scripts\Hotkey Help.ahk"
"scripts\desktop-switcher.ahk"
"scripts\autohotkey-original.ahk"
"scripts\expansions.ahk"
)
expansions.ahk has hotstrings and one hotkey (added to see if I can see the help)

Code: Select all

^F11:: ; Ctrl F11 starts vi
IfWinExist ahk_class Vim
     WinActivate
else
     Run z:\bin\vim\gvimPortable.exe
return

::abababab:: ; test message
(
test
)
When I right click on autohotkey icon in the status bar, I see all four scripts (as shown in the attached picture)
ahk-rtclick.jpg
ahk-rtclick.jpg (22.96 KiB) Viewed 5160 times
and then when I go to hotkeys for expansions, I see cryptic information about the hotkey and no hotstrings. But I do not see any documentation.
ahk-hotkeys.jpg
ahk-hotkeys.jpg (15.46 KiB) Viewed 5160 times
what should I change to make this work?
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

21 Jul 2020, 17:17

tnkrer wrote:
18 Jul 2020, 16:52
Either this is not working for me or I am missing something.

I have a startup script - (copy of AHK Startup) which has a few scripts in the Join section. One of which is Hotkey Help
This is how that section looks

Code: Select all

Files := [	; Additional Startup Files and Folders Can Be Added Between the ( Continuations  ) Below
(Join, 
"scripts\Hotkey Help.ahk"
"scripts\desktop-switcher.ahk"
"scripts\autohotkey-original.ahk"
"scripts\expansions.ahk"
)
expansions.ahk has hotstrings and one hotkey (added to see if I can see the help)

Code: Select all

^F11:: ; Ctrl F11 starts vi
IfWinExist ahk_class Vim
     WinActivate
else
     Run z:\bin\vim\gvimPortable.exe
return

::abababab:: ; test message
(
test
)
When I right click on autohotkey icon in the status bar, I see all four scripts (as shown in the attached picture)
ahk-rtclick.jpg
and then when I go to hotkeys for expansions, I see cryptic information about the hotkey and no hotstrings. But I do not see any documentation.
ahk-hotkeys.jpg
what should I change to make this work?

Hotkey Help is not really something that you use the right-click context menu to access. The default key to access is Win+F1. When you hit that hotkey with Hotkey Help running, it should bring up a list of all your running scripts and what hotkeys they have within them. You have to add comments within the scripts if you want the hotkeys to have a description beyond just a list of the keys to activate.

What you are seeing through the right-click context menu is the debugging functions provided by AutoHotkey for all scripts and given access to through AHK Startup.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHKxx
Posts: 73
Joined: 26 Feb 2014, 01:37

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

28 Jul 2020, 16:54

Hello Fanatic Guru,

I've been using both your Hotkey Help and AHK Startup scripts for several years and have come to depend on them. The Hotkey Help script is actually one of the scripts I run using the Startup script, and they work beautifully together as a system. But there is something about how I've set things up that I no longer recall and can't figure out.

When I press Win+F1, Hotkey Help opens as expected. I use this to edit scripts using Notepad++.

I would like to move the installation of NP++ to a new location. But I cannot determine how the Hotkey Help (HH) script is getting the location of NP++. It is not indicated in the HH script itself.

When I make the current location of NP++ unavailable, HH opens the scripts for editing in the regular Windows Notepad. When I make it available again, HH again edits scripts in NP++.

AHK is set as the default app for .ahk files, and NPP++ is set as the default app for txt files.

But how does the HH script know to use NP++?

FWIW, I m using an old version of HH, 2.88, from 2013, but I wouldn't think that's a factor.

Any insight here appreciated.

Thank you!
ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

29 Jul 2020, 03:32

I think that you need to change the registry key :

Code: Select all

HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command
AHKxx
Posts: 73
Joined: 26 Feb 2014, 01:37

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

29 Jul 2020, 04:25

That was it!

I should have done a registry search and found it, but I got stuck thinking it might be in a script or how AHK was set up.

Thanks.

Those two scripts are at the center of all my set ups.
fubarsanfu
Posts: 2
Joined: 18 Jan 2021, 12:01

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

11 Feb 2021, 08:01

I really like this script but find that I have far too many items as I have a lot of #IfWinActive etc.

Has anyone looked at changing this so each file can be shown in a tab gui ?
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

11 Feb 2021, 19:07

fubarsanfu wrote:
11 Feb 2021, 08:01
I really like this script but find that I have far too many items as I have a lot of #IfWinActive etc.

Has anyone looked at changing this so each file can be shown in a tab gui ?

All the information is collected in an array object called "Help". Then a display dialog is created from information out of that array. So I imagine the dialog could be customized to put different information on different tabs for each script file. In theory it would probably not be super hard but there would probably be a lot of quirks to iron out with creating a dynamic number of tabs. I don't really have the time right now to under take the project myself. It is kind of an interesting idea though so maybe I will circle back to it at some point.

Originally the dialog was created in a simple style so it could be printed out.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
User avatar
kunkel321
Posts: 957
Joined: 30 Nov 2015, 21:19

Re: Hotkey Help - Whitelist?

22 Feb 2021, 15:40

Firstly, thanks for sharing this Fantastic! It's awesome!
My idea/request: A pattern-based whitelist for a particular script.
My scenario: I'm using the excellent and ubiquitous AutoCorrect.ahk script. I have a bunch of work-related hotstrings (in addition to other various tools). I've put them all in the same script, just so that I only need one running. I don't need Hotkey Help to process the thousands of autocorrect entries, but it would be nice if it returned my work items though... My standard operating procedure has been to prefix my custom hotsring triggers with a semicolon like ::;btw::by the way so I'd like to exclude all hotstrings except those that start with ";".

Maybe something like exclude :;*::. I guess this is a pretty specific request. Just an idea. ;)
ste(phen|ve) kunkel

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: KnIfER, Rohwedder and 87 guests