Menu Information Display

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
bevhoward
Posts: 56
Joined: 30 May 2016, 13:03
Location: Austin, Texas, USA
Contact:

Menu Information Display

21 Nov 2020, 15:56

This is probably in the ahk help or here, but, I apologize, but I can't find it.

I'm using an increasing number of dedicated keys such as +F12 and, with age and chemo related memory issues, I would like to create a display list of these keys callable in my ahk menu.

The first thing that comes to mind is to add a submenu for these strings that display the keys they are assigned to.

However, I'm guessing that there is a way to add a non functional line to a menu that displays text or, perhaps an option to display simply a text box that can be exited using ESC

As a clarification, I need the dedicated keys as I am coming across a number of web instances where, if I try to use the AHK menu to insert text, calling the menu causes the field that I am trying to populate to loose focus, but a dedicated key works.

Thanks in advance,
Beverly Howard
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Menu Information Display

21 Nov 2020, 16:46

Code: Select all

hkeys =
(
F2 = This
F3 = That
F4 = The other
)
Gui, hkeys:New,, Hotkeys
Gui, Font, s10
Gui, Add, Text,, %hkeys%
Gui, Add, Button, Hidden Default w0 h0, OK

F12::
SoundBeep, 1500, 20
Gui, hkeys:Show, w200
Return

hkeysGuiEscape:
hkeysGuiClose:
hkeysButtonOK:
SoundBeep, 1000, 20
Gui, hkeys:Hide
Return
Also: https://autohotkey.com/board/topic/32370-hotkey-helper/
User avatar
bevhoward
Posts: 56
Joined: 30 May 2016, 13:03
Location: Austin, Texas, USA
Contact:

Re: Menu Information Display

21 Nov 2020, 17:47

Thanks!

I think I understand. Will tinker with it tonight.

Beverly Howard
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Menu Information Display

21 Nov 2020, 17:51

There's not much to it. You can expand hkeys variable. You then just press F12 to show the value. The Gui commands just show the value as text in a GUI so that it looks decent. The bottom part lets you press Esc to hide it. An alternative is that you can press Enter. Below is another way to write it.

Code: Select all

Gui, hkeys:New,, Hotkeys
Gui, Font, s10   ; Font size
Gui, Add, Text,, ; These are the text items
(
F2 = This
F3 = That
F4 = The other
)
Gui, Add, Button, Hidden Default w0 h0, OK ; Hidden button to enable ENTER to hide

F12::                  ; F12 = Show the GUI
SoundBeep, 1500, 20
Gui, hkeys:Show, w200
Return

hkeysGuiEscape:        ; Esc = Hide the GUI
hkeysGuiClose:         ; Can also click the "X" to hide
hkeysButtonOK:         ; ENTER will also trigger this routine
SoundBeep, 1000, 20    ; Love the little beeps!
Gui, hkeys:Hide        ; Hide the GUI
Return
User avatar
bevhoward
Posts: 56
Joined: 30 May 2016, 13:03
Location: Austin, Texas, USA
Contact:

Re: Menu Information Display

21 Nov 2020, 18:15

>> There's not much to it. <<

Right ...easy for you to say ...you don't know how dense my brain can be ;-)

>> listhotkeys <<

This displays exactly the info I need for this, plus, it's all there including assignments I have forgotten. My script is now over 700 lines.

Again, probably super dumb, but is it possible to call this command from an ahk menu? (I have never used the AHK interface, just the menu script that I wrote)

"listhotkeys" works if I put it in the script, but, it only calls the interface when the menu script is loaded.

My need is to display it a few days after the computer has been rebooted and I can't remember a key assignment.

Beverly
User avatar
bevhoward
Posts: 56
Joined: 30 May 2016, 13:03
Location: Austin, Texas, USA
Contact:

Re: Menu Information Display

21 Nov 2020, 18:28

The obvious option is to simply use the "Open" option in the toolbar icon... that works!

Thanks again,
Beverly

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], peter_ahk and 335 guests