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

Hotkey Help - Display Active AHK Hotkeys and Hotstrings

02 Oct 2013, 13:36

Hotkey Help

This script creates a Hotkey Help dialog that shows all the Hotkeys found in all of the AHK files currently running.

It finds the names of all the running AHK programs through looking at Hidden Windows. This is done by a function that others might find useful. I have commentted this function at the end.

It then scans those AHK files for hotkeys and hotstrings.

It also scans those files for #Include and then recursively scans those files also.

It can detect compiled AHK EXE files but it can not scan them for hotkeys and those EXE would not contain any help comments so instead it looks for an AHK file with the same name as the EXE in the same location, working directory, or script directory; and scans it if found.

In a similar fashion Help will also look for a text file with the same names as the AHK script and get hotkey information and comments from that file if it exist.

You can change the settings within the running script and save your settings to an INI file.

There are various settings that can be adjusted and saved to the INI file.

You can also edit the script at the top to add specific files, hotkeys, and hotstrings to ignore.

When the Help dialog is the active window, control+f will bring up a "Find" command.

The Find dialog attempts to find open space to dock in this order: bottom under outside, bottom right outside, bottom left outside, and then inside the window in the bottom right. But the Find dialog can also be dragged to a location. This location is remembered in relation to the top left corner of the Help dialog. If you double click the status bar of the Find dialog it will reset location and redock. The settings also has an option to save the Find dialog location in the settings INI file and remember between sessions. As well as a button to reset the location if for some reason you undocked it then moved the parent window to cause the Find dialog to be lost off screen.


Link to DOWNLOAD CODE:
Hotkey Help.ahk
Version: 2019 01 03
(44.18 KiB) Downloaded 2275 times


SAMPLE DIALOG

Code: Select all

SAMPLE DIALOG
============================= HOTKEY HELP ============================
Win+f1                <--- Show Hotkey Help
Win+Alt+f1            <--- Change Hotkey Help Settings
Win+Ctrl+f1           <--- Display Files, Hotkeys, and Hotstrings Excluded

============================ GOOGLE SEARCH ===========================
Win+g                 <-- Google Search Highlighted Selection
Win+Ctrl+Alt+Escape   

============================= DICTIONARY =============================
Win+Alt+d             <-- Open Dictionary Input Box
Win+Ctrl+d            <-- Dictionary Search Highlighted Selection
Win+Ctrl+Alt+Escape   

========================== HOTSTRING HELPER ==========================
Win+h                 <-- Create Hotstring for Selected Text
Win+Ctrl+Alt+Escape   
HotString: tdate      <-- Today's Date
HotString: pfa        = please find attached

======================== STARTUP - AUTOHOTKEY ========================
Win+Ctrl+Alt+Escape   

============================= SECURE PDF =============================
Win+Ctrl+s            <-- Secure PDF
Win+Alt+s             <-- Unsecure PDF

======================== EMAIL ATTACHMENT LIST =======================
Win+a                 <-- Add email attachment list as single line
Win+Ctrl+a            <-- Add email attachment list table
Win+Alt+a             <-- Add email attachment list table with file numbers

++++++++++++++++++++++++++++ IMAGE CAPTURE +++++++++++++++++++++++++++
PrintScreen            capture drawn rectangle
ScrollLock             capture active window
Pause                  capture active monitor
Ctrl+Escape           

+?+?+?+?+?+?+?+?+?+?+?+?+?+?+? MTGO FREE +?+?+?+?+?+?+?+?+?+?+?+?+?+?+
+-+-+-+-+-+-+-+-+-+-+-+-+-+- CLICK - TRADER +-+-+-+-+-+-+-+-+-+-+-+-+-
------------------------------ TILLAGOTO -----------------------------
------------------------------- TOOLBAR ------------------------------
---------------------------- PLATFORMREAD ----------------------------
---------------------------- COMINTERFACE ----------------------------
---------------------------- SCITEDIRECTOR ---------------------------
----------------------------- SCITEMACROS ----------------------------
---------------------------- PROFILEUPDATE ---------------------------
To get a good looking dialog it is important to put a helpful comment after every hotkey in your scripts. Preferrable in a uniform format.

I do.

#a:: ; <--- This is a Sample Hotkey

The spacing between the :: and ; is not important as the script parses for the imformation and then spaces it uniformily.

Because it is using RegEx to attempt to identify Hotkeys it can probably be fooled. It attempts to weed out things that look like hotkeys but are not like text in comments or the use of :: in weird places.

Through information about values stored in variables that running scripts can be forced to report the Help attempts to evaluate the key definitions of hotkeys created with keys defined by variables. It is not always correct though because Help can only determine the current value of a variable which may not necessarily be the same as it was when a hotkey was created using that variable.

A raw view of hotkey combinations being used by all running scripts can be seen also. This information is retrieved from the running scripts directly so contains no comments but should pickup most all current hotkeys.

Also the main help dialog contains buttons for Stopping, Pausing, Suspending, Editing, Reloading and Opening scripts.

A text file can also be created with the same name as an AHK script that can contain help information without having to edit the actual AHK script. Txt is the default extension but custom extensions can be defined in the variable initialization of Hotkey Help. Sometimes when dealing with other peoples scripts it is easier to just put the help comments in a txt file especially if they update the script a lot causing it having to be re-commented each time it is updated.

These text help files need to contain a hotkey definition line with :: and ; similar to an actual hotkey definition line in a script. ie.
^#a:: ; <-- ~ Word ~ Save All Files
^#a:: ; <-- ~ Adobe ~ Authorization Stamp
^#b:: ; <-- Backup

FG
Last edited by FanaticGuru on 04 Jan 2019, 14:05, edited 9 times in total.
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

12 Mar 2014, 07:28

This is fantastic and will help this noob enormously.

Thank you for sharing your work!

Wow. :D
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

29 Apr 2014, 12:33

Updated in First Post

Change Log: Version 2.90 (2014-04-24)
Improved RegEx to better handle #include that has comment after command
Parser now looks for chain of circular #includes that would cause script to go into an infinite incursive loop

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
ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

10 Jun 2014, 01:57

I know I digg up a little old post.
I had an idea but no way that I'm doing it (I don't have the knowledge).
So here it is:
Something like this but as a lib. So when included it's lisling on the tray menu of the script the Active AHK Hotkeys and Hotstrings of the script.
Or maybe, if it's possible, something in an automatic way so we don't have to modify every script.

Am I clear enough? I'm not sure
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

10 Jun 2014, 14:48

ozzii wrote:I know I digg up a little old post.
I had an idea but no way that I'm doing it (I don't have the knowledge).
So here it is:
Something like this but as a lib. So when included it's lisling on the tray menu of the script the Active AHK Hotkeys and Hotstrings of the script.
Or maybe, if it's possible, something in an automatic way so we don't have to modify every script.

Am I clear enough? I'm not sure
It is all doable.

I could probably add an option to this Hotkey Help script to modify the tray icons to display hotkeys and hotstrings.

My AHK Startup script already adds the ability to access some of this information from its tray icon.

Another possibility is adding a tooltip with the information to the tray icons but tooltips have a restrictive length limit.

The coding part is not so much the limit as the logistic part of how to arrange or display the information in the tray menu so it is not overly cluttered.

Hotstrings can be especially problematic to display on the tray icon menu because some scripts might contain a lot of hotstrings.

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
ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

11 Jun 2014, 03:11

Well I thought about just hotkeys sorry.
In that way, in the icon of the script we can see the hotkey for that script
I thought that the info is on the top of the tray menu.

I will test your "AHK Startup" script.
AHKxx
Posts: 73
Joined: 26 Feb 2014, 01:37

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

14 Jun 2014, 12:34

How can I make Hotkey Help use Notepad++ when it opens a script for editing?

I just did a clean installation of Windows 7, and the Hotkey Help script is using the native Windows Notepad. I'm pretty sure that previously it would open scripts in NPP. am I remembering that incorrectly, or have I just forgotten how to configure it for that?

Thanks again for this great script.
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

14 Jun 2014, 22:40

AHKxx wrote:How can I make Hotkey Help use Notepad++ when it opens a script for editing?

I just did a clean installation of Windows 7, and the Hotkey Help script is using the native Windows Notepad. I'm pretty sure that previously it would open scripts in NPP. am I remembering that incorrectly, or have I just forgotten how to configure it for that?

Thanks again for this great script.
That is not defined anywhere in my script. What editor is used is a Windows thing. It uses the default editor defined for AutoHotkey.

For example with me it opens up in SciTE4AutoHotkey.

I believe you have to change it in the register here:

HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command

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

14 Jun 2014, 22:53

ya i had looked to see if it was defined in the script and kind of suspected it wouldn't be.

But editing the registry key did it. Thanks.
User avatar
DyNama
Posts: 14
Joined: 26 Jul 2014, 14:00
Location: Ohio, USA
Contact:

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

01 Aug 2014, 16:21

Pretty fantastic, FanaticGuru!

As i mentioned in another thread, i keep a keyboard map to track my used hotkeys, and i also maintain my own help screen, otherwise i'd forget what keys i assigned them to.
hotkey_help.jpg
My own help screen over top Hotkey Help
Your program will be a great help too! i did immediately have to exclude spellcheck program AutoCorrect for AHK-L.ahk, it's got hundreds of hotstrings in it, i don't need a list of those.
PJ_in_FL_USA
Posts: 4
Joined: 25 Aug 2014, 15:09
Location: USA

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

25 Aug 2014, 15:21

Hello!

My first post to AHK forum and I'd like to start by thanking FanaticGuru for sharing these tools with the community!

I created "AHK Startup.ahk" from the other source posted in that forum and have that script up and running using the subfolder format to load everything in my .\$Startup folder at one time. Great piece of code!

My request is to see if the .ahk source for "Hotkey Help.ahk" can be posted, too? I'm unable to access the link given in the original post.

Thanks again!
----------------------
PJ in FL
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

25 Aug 2014, 15:42

PJ_in_FL_USA wrote:Hello!

My first post to AHK forum and I'd like to start by thanking FanaticGuru for sharing these tools with the community!

I created "AHK Startup.ahk" from the other source posted in that forum and have that script up and running using the subfolder format to load everything in my .\$Startup folder at one time. Great piece of code!

My request is to see if the .ahk source for "Hotkey Help.ahk" can be posted, too? I'm unable to access the link given in the original post.

Thanks again!
----------------------
PJ in FL
The link to the script code works fine for me. It might have just been a temporary internet thing.

I sent it to you in a private message.

If others have trouble with the link, I will include the code in the forums without a link. The script is pretty long and the link just makes it easier when I do an update but this script has matured and I do not need to update it very often now.

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
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

03 May 2015, 10:26

Bloody useful!
Brilliant idea!

greetings
jdefgts
Posts: 2
Joined: 04 Mar 2016, 15:56

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

21 Mar 2016, 20:16

This is a really terrific and very useful program. I do have one problem with it that I can't seem to get around. Any insight that anyone has will be greatly appreciated. I am running Hotkey Help v. 2.90 as downloaded. In all of my scripts if I am using a hotstring to trigger an action, the help file always displays the ";" as part of the HS description so that this code:

Code: Select all

::btw:: ; <-- Message "btw"
MsgBox You typed "btw".
return
produces the following listing in the help file:
<HS> btw = ; <-- Message "btw"
Is there something I can do to prevent the ";" from being displayed?

I really appreciate this board and the help I receive from it. Thanks!
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

22 Mar 2016, 00:36

Updated in First Post

Change Log: Version 2.92 (2016-03-22)
Better handling of a hotstring defined to perform a custom action that has a comment after the hotstring trigger.

Example:

Code: Select all

::btw:: ; <-- Message "btw"
MsgBox You typed "btw".
return
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
jdefgts
Posts: 2
Joined: 04 Mar 2016, 15:56

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

22 Mar 2016, 07:17

Thanks! That works perfectly. I really appreciate the rapid response.
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

22 Mar 2016, 16:16

That's a great script FG! Good work! Is there someone who has come up with a script that has what's on the top of the hotkey list? Like the list of all running scripts and do different things with them.
try it and see
...
Guest

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

22 Mar 2016, 19:05

derz00 wrote:That's a great script FG! Good work! Is there someone who has come up with a script that has what's on the top of the hotkey list? Like the list of all running scripts and do different things with them.
https://autohotkey.com/board/topic/3865 ... -end-them/
Guest

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

24 Oct 2016, 10:00

How can I make the display context senitive? I would like to display only the macros relevant to the currently active window.
User avatar
FanaticGuru
Posts: 1905
Joined: 30 Sep 2013, 22:25

Re: Hotkey Help - Display Active AHK Hotkeys and Hotstrings

24 Oct 2016, 12:49

Guest wrote:How can I make the display context senitive? I would like to display only the macros relevant to the currently active window.
There is no easy way to do this because there is no easy way to determine what macros are relevant to what windows. Even with the #if command being used AutoHotkey does not evaluate the #if command until the hotkey is pressed. The #if can also be dynamic like #if (Toggle = true). So doing it by analyzing the code is impractical to impossible.

You could add a remark to the end of every hotkey line in your scripts with the WinTitle that you wanted the hotkey to only be displayed if active and then parse that information out and use it to control the display of information in the Help dialog.
Something like ^f12:: ; <--- Generic Description ~ahk_class Notepad~.

It would be cumbersome and quite a bit of work to implement properly.

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

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: furqan, TheNaviator and 80 guests