GUI will be the final evolution way that ahk experts merge into?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
joyrr5092
Posts: 41
Joined: 28 Dec 2023, 09:54

GUI will be the final evolution way that ahk experts merge into?

15 Feb 2024, 05:08

ok, i made 1000+ hotkeys, i use wintab, no 2' KB.
i think i can only rely on a GUI?

ps: on desktop, i'll use mediachance's commercial multi keyboard macros. it let your 2nd keyboard be recognized as 2nd, and not the same as the 1st.
foss alternative is laumacro, and diy QMK? keyboards.

on a windows tab, while on the go, there is NO extra keyboard, not even a mouse but a stylus.

a chinese ahk-alike (close source, seems use C# thus not exactly a clone) called "quicker" is more mouse-oriented in mind:
image.png
image.png (49.48 KiB) Viewed 419 times
i knew that ahk also support GUI.
I tried QAP which handle the items by TREE structure. but it's too fat, on my 3PCs it loads and loads itself, despite i disabled the "database" function and the network drives.


so, is the "quicker" GUI way, that somehow could handle 1000+ items, is the way to go?

it's hard to sqeeze 1000+ items inside it.
either you use TREE like QAP or radial menu v4,
scrolling,
filters......

what else?

thanks
User avatar
mikeyww
Posts: 27241
Joined: 09 Sep 2014, 18:38

Re: GUI will be the final evolution way that ahk experts merge into?

15 Feb 2024, 07:09

Hello,

If you are using the hotkeys to send text (and sometimes even for other things), hotstrings are probably a better choice, because they are simpler and more natural to remember. This will yield both faster coding and faster usage. If needed, these can also be turned into a nested menu.

I use a combination: many hotstrings to send various text, and a few dozen hotkeys that I use most frequently to send text.

Another problem with having 1000 hotkeys is that you are likely to override some useful ones that other programs routinely use. This is rare for any hotstring.

If you love hotkeys, another option is a launcher or prefix key. Popular launchers will often use this. It is a trigger key that you press to enable all other hotkeys to become enabled (possible to trigger). This could also be combined with a simple menu or filtering system to type text. At that point, you would be replicating what several free launcher programs already do.

I made my own launcher. It is a ListView triggered by a hotkey. Some benefits are named below.
  1. Fast and simple to adjust. One ListView imports a text file that I can quickly modify. Another ListView imports LNK file names from a directory that I specify. With this approach, my manual management is minimal.
  2. ListView has a native type-ahead feature so that I do not need to click anything. I trigger the ListView and then type a letter or two to get to the entry that I want. I then just press ENTER, and I'm done.
  3. I can show multiple columns of information simply and efficiently, with a readable layout. My imported text file has three fields that are comma-separated: text shortcut, description, and URL. When I trigger that ListView, I type the text shortcut that I defined-- which I can also see in the ListView-- and the script then navigates to the URL. It's fast and simple. Some Web browsers would call this type of text shortcut a keyword or alias.
  4. My ListView with LNK files essentially updates itself when I drop a new LNK file into the designated target directory. All I need to do is reload the script. I do not even need to do that when my computer restarts, because the script is reloaded at that time.
joyrr5092
Posts: 41
Joined: 28 Dec 2023, 09:54

Re: GUI will be the final evolution way that ahk experts merge into?

15 Feb 2024, 08:11

mikeyww wrote:
15 Feb 2024, 07:09
Hello,

If you are using the hotkeys to send text (and sometimes even for other things), hotstrings are probably a better choice, because they are simpler and more natural to remember. This will yield both faster coding and faster usage. If needed, these can also be turned into a nested menu.

I use a combination: many hotstrings to send various text, and a few dozen hotkeys that I use most frequently to send text.

Another problem with having 1000 hotkeys is that you are likely to override some useful ones that other programs routinely use. This is rare for any hotstring.

If you love hotkeys, another option is a launcher or prefix key. Popular launchers will often use this. It is a trigger key that you press to enable all other hotkeys to become enabled (possible to trigger). This could also be combined with a simple menu or filtering system to type text. At that point, you would be replicating what several free launcher programs already do.

I made my own launcher. It is a ListView triggered by a hotkey. Some benefits are named below.
  1. Fast and simple to adjust. One ListView imports a text file that I can quickly modify. Another ListView imports LNK file names from a directory that I specify. With this approach, my manual management is minimal.
  2. ListView has a native type-ahead feature so that I do not need to click anything. I trigger the ListView and then type a letter or two to get to the entry that I want. I then just press ENTER, and I'm done.
  3. I can show multiple columns of information simply and efficiently, with a readable layout. My imported text file has three fields that are comma-separated: text shortcut, description, and URL. When I trigger that ListView, I type the text shortcut that I defined-- which I can also see in the ListView-- and the script then navigates to the URL. It's fast and simple. Some Web browsers would call this type of text shortcut a keyword or alias.
  4. My ListView with LNK files essentially updates itself when I drop a new LNK file into the designated target directory. All I need to do is reload the script. I do not even need to do that when my computer restarts, because the script is reloaded at that time.
hi,
thanks for reply.

1.
however i am mostly interested in HOTKEYS, for doing things, not replacing typing text.

2. it's quite like MCQ vs fill in the blanks. i cant active recall that 1000+ hotkeys,
but if that 1000+ hotkeys are listed out clearly (name, exact hotkey e.g. +C, )+/-icon, i could RECOGNIZE them.


3. i googled, there are already many existing launchers.
some open source, some close source, some /w it's own license.
like launchQ, it's derivates,
radial menu v4,
QAP,
among many many others.
however they mostly use the ListView like you say (the "quick launch" function in QAP),
in which the items are just a line of text. it will take me some effort to make the text EDITABLE (if possible, for font color, style, size, i think),
and add ICONS (for some hotkeys).

so far, i think QAP do support icons (it's heavy weight) but it's too heavy.
my mouse cursor loads and loads.

summary:
no perfect script yet.
even if i am enough time to make it happen, it's not in near future.
currently could only adapt others and tolerate.

thank you.
User avatar
mikeyww
Posts: 27241
Joined: 09 Sep 2014, 18:38

Re: GUI will be the final evolution way that ahk experts merge into?

15 Feb 2024, 10:18

Code: Select all

#Requires AutoHotkey v1.1.33
shortcut := " ; Aliases and descriptions
(
ah,AutoHotkey
ms,Microsoft
)"
; ----------------------------------------------------------------
Gui Font, s10
Gui Add, Button, Hidden Default, OK
Gui Add, ListView, w640 r20 vshortcutsLV gGo, Alias|Description
LV_SetImageList(icon())
For each, line in StrSplit(shortcut, "`n") {
 part := []
 Loop Parse, line, CSV
  part.Push(A_LoopField)
 LV_Add("Icon" A_Index, part*) ; Add row to ListView: icon, alias, description
}
LV_ModifyCol(1, 40)            ; Adjust column width
LV_ModifyCol(2, 540)           ; Adjust column width
Gui Show,, Shortcuts
Return

Go:       ; User acted upon the ListView
If (A_GuiEvent = "DoubleClick")
 Gosub Exec
Return

ButtonOK: ; User pressed ENTER
GuiControlGet focusedControl, FocusV
If (focusedControl != "shortcutsLV")
 Return
Exec:     ; Gosub subroutine whose name is in the ListView's second column
LV_GetText(sub, LV_GetNext(0, "Focused"), COL := 2)
Gosub % sub
Return

; -------------------------------------------------------------------
; Subroutines
AutoHotkey:
Run http://www.autohotkey.com/
Return

Microsoft:
MsgBox
Return
; -------------------------------------------------------------------

icon() {  ; Build image list with icons
 Static nIcons := 10 ; Number of icons
 imageList := IL_Create(nIcons)
 Loop % nIcons
  IL_Add(imageList, "shell32.dll", ICONNUMBER := A_Index) ; Add icon to image list
 Return imageList
}
joyrr5092
Posts: 41
Joined: 28 Dec 2023, 09:54

Re: GUI will be the final evolution way that ahk experts merge into?

15 Feb 2024, 10:25

wow, thanks

looks good, later i could adapt to my script, which i'll take from an existing one.

screenshot:
image.png
image.png (17.03 KiB) Viewed 376 times

"analysis"

This AutoHotkey (AHK) script creates a graphical user interface (GUI) with a list of shortcuts to various resources, where each shortcut is associated with an alias and a description. Here's a breakdown of its key components and functionalities:

1. Initialization of Variables and Shortcut Definitions : The script starts by defining a variable `shortcut` that holds aliases and descriptions in a structured format. These are essentially key-value pairs where the key is an abbreviation (e.g., "ah" for AutoHotkey, "ms" for Microsoft) and the value is the full name or description.

2. GUI Setup : The script sets the font for the GUI and then adds two elements:
- A hidden "OK" button, which is set as the default action button.
- A ListView control that is configured to display the shortcuts with two columns: "Alias" and "Description". The ListView is associated with an image list that contains icons from "shell32.dll".

3. Image List Creation : It creates an image list to store icons that will be used in the ListView. Icons are added from "shell32.dll" based on the loop iteration index.

4. Populating the ListView : The script populates the ListView with rows where each row includes an icon, the alias, and the description of a shortcut. It does this by splitting the `shortcut` variable content into lines and further parsing each line to extract the alias and description.

5. ListView Column Adjustment : It adjusts the width of the columns in the ListView to ensure that the content is properly displayed.

6. GUI Display : Shows the GUI window titled "Shortcuts".

7. Event Handling :
- `Go` Label: Handles double-click events on the ListView items. When an item is double-clicked, it attempts to execute a subroutine based on the alias's description.
- `ButtonOK` Label: Handles the ENTER key press. If the ListView is focused and ENTER is pressed, it triggers the execution of the associated subroutine.
- `Exec` Label: Fetches the description of the focused item in the ListView and executes a subroutine based on this description.

8. Subroutines : Defines two subroutines (`AutoHotkey` and `Microsoft`) that are executed based on the alias selected. For example, selecting the "ah" alias and triggering the subroutine will open the AutoHotkey website, whereas selecting "ms" will display a message box (though the message box command is incomplete).

In summary, this script is a utility for quickly accessing various resources through a GUI by double-clicking on an alias in the list, where each alias corresponds to a specific website or action.
User avatar
mikeyww
Posts: 27241
Joined: 09 Sep 2014, 18:38

Re: GUI will be the final evolution way that ahk experts merge into?

15 Feb 2024, 10:53

Excellent summary!

The chief purpose of the alias in the ListView is to allow the user to type the alias on the keyboard. This jumps to (focuses) the corresponding row.

:) :thumbup: :wave:
joyrr5092
Posts: 41
Joined: 28 Dec 2023, 09:54

Re: GUI will be the final evolution way that ahk experts merge into?

15 Feb 2024, 10:59

mikeyww wrote:
15 Feb 2024, 10:53
Excellent summary!

The chief purpose of the alias in the ListView is to allow the user to type the alias on the keyboard. This jumps to (focuses) the corresponding row.

:) :thumbup: :wave:
obviously, it's by AI and not me.
and it looks like codes by AI are discouraged, summary is not.

indeep, if you give a full text to AI and ask it to summarize, it did a very good job.
but if you ask AI an open question, 50% it could gone wrong.
User avatar
mikeyww
Posts: 27241
Joined: 09 Sep 2014, 18:38

Re: GUI will be the final evolution way that ahk experts merge into?

15 Feb 2024, 11:07

That's a cool summary, is impressive in its level of detail and accuracy.
joyrr5092
Posts: 41
Joined: 28 Dec 2023, 09:54

Re: GUI will be the final evolution way that ahk experts merge into?

11 Mar 2024, 05:21

i still wish to discuss if someone could enlighten me, i make the msg more consiced /w gpt:

Hello everyone,

I've been deep-diving into AHK, creating over 1000 functions tied to various key combinations, utilizing additional keyboards (2nd and 3rd 108 keys keyboard) and F13-F24 keys through Mediachance's MKM. Despite organizing these with MindManager and A4 mind maps, the sheer volume of shortcuts has become unmanageable.

I'm contemplating whether transitioning these functions into a compact, scrollable GUI—possibly with a tree structure or filters for better organization—would be a more practical approach. This would allow me to easily access and manage these functions directly from my screen.

What are your thoughts on this? Would a GUI offer a significant advantage in managing such a vast number of functions, or are there better alternatives I should consider?

Thanks for your input!
User avatar
mikeyww
Posts: 27241
Joined: 09 Sep 2014, 18:38

Re: GUI will be the final evolution way that ahk experts merge into?

11 Mar 2024, 06:38

My thoughts are below.
  1. This thread provides examples and discussion that may help you.
  2. A GUI can serve as a useful memory aid in this situation.
  3. Hotstrings are another option.
  4. These approaches can be tested quickly in your own small demonstrations, so that you can weigh the tradeoffs and pursue your preference.
  5. Various launchers have been written and posted on the forum and elsewhere online. Many are free to test and use.
joyrr5092
Posts: 41
Joined: 28 Dec 2023, 09:54

Re: GUI will be the final evolution way that ahk experts merge into?

11 Mar 2024, 07:35

Various launchers have been written and posted on the forum and elsewhere online. Many are free to test and use.<---

i will appreciate more if you could tell me which one you use, or which existing one. thanks.

btw, i tried the QAP which is very very feature rich but it's too fat now.
my PC is slowed down by it.

thanks
User avatar
mikeyww
Posts: 27241
Joined: 09 Sep 2014, 18:38

Re: GUI will be the final evolution way that ahk experts merge into?

11 Mar 2024, 07:47

This thread shows an example of a handy ListView. I use a couple of ListViews in my own scripts. One navigates to URLs; the other runs programs. These ListViews are populated from text files or directories of LNK files. The ListViews also have simple keywords so that I can jump to specific rows by typing a few letters.

Lintalist is a popular AHK launcher. Some other launchers are Keypirinha and Launchy. There are lots of them. You can search and then try a bunch. Beyond this thread, this forum also has others that you can find by searching.
joyrr5092
Posts: 41
Joined: 28 Dec 2023, 09:54

Re: GUI will be the final evolution way that ahk experts merge into?

11 Mar 2024, 10:15

I'm looking for a GUI launcher that goes beyond file handling, similar to Quick Access Popup (QAP), which can manage files, folders, and hyperlinks. Importantly, it should support sending text and AutoHotkey (AHK) shortcuts liks +s for shift s, like QAP does.

While QAP covers most needs, its main UI is tree-based and becomes cumbersome with over a thousand items. The "quick search" feature which they added recently, is a ListView, but lacks functionality beyond listing items. Reasonable as they only added this last year 2023.

Despite QAP's capabilities, its resource usage is high. With my system (i5 8250 CPU, 32GB RAM, 16GB+ available), I experience persistent loading, even with its usage database turned off, which is why I uninstalled it.

Creating a custom GUI launcher is a significant time investment, even with the aid of GPT-4, due to the specific functionalities I'm looking for, such as moving the interface between monitors seamlessly.

I appreciate the help and might allocate dedicated time or resources to develop this solution.

Thank you for your time.
User avatar
mikeyww
Posts: 27241
Joined: 09 Sep 2014, 18:38

Re: GUI will be the final evolution way that ahk experts merge into?

11 Mar 2024, 10:24

The script posted in this thread gives you a head start. You can move the GUI window to be where you like. AutoHotkey itself uses minimal resources. For a simple ListView, you would probably find that the CPU usage is approximately zero.

We find that using ChatGPT to write AutoHotkey scripts yields varying results, ranging from adequate to terrible and time-wasting-- usually the latter.
joyrr5092
Posts: 41
Joined: 28 Dec 2023, 09:54

Re: GUI will be the final evolution way that ahk experts merge into?

11 Mar 2024, 11:15

I dont want to waste you time,

however, i must share you 1 thing that I love gpt so much, happening tonite.

i use anki which is a flashcard program.

an addon introduce the URL handler ankilink:// to anki on windows.

however, the update of the addon didn't handle the changed location of the anki.exe.

that is almost NO resources on web that will help, NOT even on the entire internet.

however, 1 single prompt made gpt4 told me that i could edit the win10 registery to simply modify the anki.exe file location in the registry.

now i can use the addon happily.

to professional users, gpt4 may be stupid -- just like if someone asked a medical doctor to test gpt4 on medical things (i am a med student).
for black and white info, gpt4 seen more and remember better than us, but for things that are quite complex, and need caution, then we human do better.

yet, for a layman to write program, gpt4 is helpful.
User avatar
mikeyww
Posts: 27241
Joined: 09 Sep 2014, 18:38

Re: GUI will be the final evolution way that ahk experts merge into?

11 Mar 2024, 11:26

My comments pertain only to chatbot roles in writing AutoHotkey scripts. I imagine that success will improve gradually. There is certainly no problem testing it. Please refrain from posting ChatGPT output on the forum.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Kellyzkorner_NJ and 113 guests