Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8661095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:24:51+00:00 2026-06-12T16:24:51+00:00

I’ve written script that contains numerous hotkeys (general structure is as below). I would

  • 0

I’ve written script that contains numerous hotkeys (general structure is as below). I would like to create another one that when pressed displays a list of all of the hotkeys and their corresponding descriptions that the script contains in a nice, formatted table.

The formatting and display are tenuous since AutoHotkey’s output is limited to message-boxes, but possible. More problematic is getting the hotkeys and corresponding descriptions.

The hotkeys all call the same function with different arguments. I considered adding a variable to the function so that depending on the value, the function either performs the normal function when triggered by the normal hotkeys, or builds a string or something when triggered from the special display hotkey.

I cannot figure out a way to programmatically access the script’s hotkeys at all. I checked the docs and there don’t seem to be any A_ variables that can be used for this purpose, nor does the Hotkey command lend itself well (it can be used to test if a hotkey exists, but looping through the innumerable combinations is, at best, tedious).

Failed attempts:

  • I tried using Elliot’s suggestion of parsing the script itself (replacing the path with %A_ScriptFullPath%, and while it does work for a raw script, it does not when the script is compiled
  • I tried assigning the entire hotkey section of the script to a variable as a continuation section and then parsing the variable and creating hotkeys using the Hotkey command. This worked well right up until the last part because the Hotkey command cannot take arbitrary commands as the destination and requires existing labels.
  • The ListHotkeys command is not applicable because it only displays the hotkeys as plain text in the control window.

Does anyone know how I can display a list of the hotkeys and either their corresponding arguments or comments?


Example script:

SomeFunc(foobar)
{
  MsgBox %foobar%
}

         !^#A::SomeFunc("a") ; blah
 ^+NumpadMult::SomeFunc("c") ; blivet
        ^+!#`::SomeFunc("b") ; baz
      ^#Space::SomeFunc("d") ; ermahgerd
 …

Example desired “outputs”:

C+A+  W+ A   a    | C+ S+   NumpadMult  b
------------------+----------------------
C+A+S+W+ `   c    | C+   W+ Space       d

    or

Ctrl Alt Shift Win  Key         Action
-----------------------------------------
 ×    ×         ×   A           blah
 ×        ×         NumpadMult  baz
 ×    ×   ×     ×   `           blivet
 ×              ×   Space       ermahgerd

etc.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:24:52+00:00Added an answer on June 12, 2026 at 4:24 pm

    I found a solution. It is not perfect (or ideal), and hopefully a proper, built-in method will become available in the future, but it works well (enough) and for raw and compiled scripts.

    What I did was to use the FileInstall command which tells the compiler to add a file to the executable (and extract it when run).

    Sadly, the FileInstall command will not allow the use of variables for the source file, so I cannot simply include the script itself (FileInstall, %A_ScriptFullPath%, %A_Temp%\%A_ScriptName%, 1).

    As a work-around, I ended up extracting all of the desired hotkeys to a second file which I then parse as Elliot suggested, then delete, and #Include at the end of my script (it must be at the end since hotkeys will terminate the autoexecute section).

    ;;;;; Test.ahk ;;;;;
    
    ; Add hotkey file to executable and extract to Temp directory at runtime
    FileInstall, Hotkeys.ahk, %A_Temp%\Hotkeys.ahk, 1
    
    Loop
    {
      ;Read a line from the extracted hotkey script and quit if error
      FileReadLine, line, %A_Temp%\Hotkeys.ahk, %A_Index%
        if ErrorLevel
          break
    
      ;Trim whitespace
      line=%line%
    
      ; Parse the line as in Elliot’s answer, but with tweaks as necessary
      ParseHotkey(line)
      …
    }
    
    FileDelete, %A_Temp%\Hotkeys.ahk ; Delete the extracted script
    DisplayHotkeys()                 ; I ended up bulding and using a GUI instead
    #Include, Hotkeys.ahk            ; It is included at compile-time, so no A_Temp
    
    
    
    ;;;;; Hotkeys.ahk ;;;;;
    
    z::MsgBox foo
    y::MsgBox bar
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a T-SQL script that migrates some data from one database to
I have written an IronPython script that generates a xml file that contains the
I have written a script that fires a jQuery POST to retrieve data from
I've written a script that changes values for a certain date in an excel
So I have a strange question. I have written a script that re-formats data
I have written a Python script that will generate a series of graphs and
I've written a simple script that displays circles over an image. When you hover
I've written a Autoit script that starts a GUI application, when the application starts
I've written a Rake script that should run automatically with Crontab. The script runs
I have a written a script in PHP that reads from data from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.