Creating a basic GUI to display shortcuts
Hello community, I am a beginner, new to this program and this family. I have a very specific task to be achieved because of my bad memory of remembering too many shortcuts in different programs.
I want to achieve the following task :
Objective: when clicked alt + h, it will show a list of all shortcuts I have mentioned for a specific program
The look of this message box or GUI:
1. Window Title of the dialog box : Shortcut List
2. It should have tabs for different program names such as Firefox, explorer, MATLAB, ANSYS, etc.
3. In each tab, there is a list of shortcut keys that I use most frequently. I should be able to add or type the keys manually in the list.
4. The dialogue box appears in the upper right corner of the screen and remains always on top until closed.
5. The dialogue box must be resizable.
Please guide me on how it can be done and where do I start? If someone can create a basic code which I can play or tweak, it will be really helpful!
Thanks community!
I want to achieve the following task :
Objective: when clicked alt + h, it will show a list of all shortcuts I have mentioned for a specific program
The look of this message box or GUI:
1. Window Title of the dialog box : Shortcut List
2. It should have tabs for different program names such as Firefox, explorer, MATLAB, ANSYS, etc.
3. In each tab, there is a list of shortcut keys that I use most frequently. I should be able to add or type the keys manually in the list.
4. The dialogue box appears in the upper right corner of the screen and remains always on top until closed.
5. The dialogue box must be resizable.
Please guide me on how it can be done and where do I start? If someone can create a basic code which I can play or tweak, it will be really helpful!
Thanks community!
Which shortcuts do you have in mind? You could create a GUI helper window with the static list of manually entered shortcuts.
this would be hugely helpful to me as well. Great idea!
Simple GUI example you could use (Type: Command):
Code: Select all
gui, myshortcuts:default
gui, destroy
text:="
(
My shortcuts:
Alt+X First shortcut
Alt+Y Second shortcut
etc.
)"
gui, font, s10, Segoe UI
gui, add, text, w200, % text
gui, show
return
-
- Posts: 8
- Joined: Oct 23rd, ’24, 06:42
Thanks Tom - that is perfect for what I would like to do also 
I previously made something similar using just AutoHotKey, but this looks way simpler
The only possible extra benefit to the below is that it allowed context specific display based on keywords in the URL so useful for keyboard shortcut reminders for specific websites
Tom - could this be incorporated into your script above? I know FastKeys can call AHK scripts but would be simpler if all in FastKeys etc
A Universal Keyboard Shortcuts Reminder
https://www.johila.org/index.php/Johila ... ew/156/230
I previously made something similar using just AutoHotKey, but this looks way simpler
The only possible extra benefit to the below is that it allowed context specific display based on keywords in the URL so useful for keyboard shortcut reminders for specific websites
Tom - could this be incorporated into your script above? I know FastKeys can call AHK scripts but would be simpler if all in FastKeys etc
A Universal Keyboard Shortcuts Reminder
https://www.johila.org/index.php/Johila ... ew/156/230
Something like this?
Code: Select all
gui, myshortcuts:default
gui, destroy
SetTitleMatchMode, 2
if WinActive("FastKeys")
{
text:="
(
My FastKeys shortcuts:
Alt+X First shortcut
Alt+Y Second shortcut
etc.
)"
}
else
{
text:="
(
My general shortcuts:
Alt+X First shortcut
Alt+Y Second shortcut
etc.
)"
}
gui, font, s10, Segoe UI
gui, add, text,, % text
gui, show
return
-
- Posts: 8
- Joined: Oct 23rd, ’24, 06:42
Hi Tom
Thanks for that response. That works well but it's relatively straightforward for applications (either using the code you provided, or via using the Window field to make it context-specific)
What I find more difficult is making it context-specific based on a word in the browser URL
With the AHK script mentioned previously (https://www.johila.org/index.php/Johila ... ew/156/230), the approach was basically as further below (note - it may look like I half know what I'm doing but this is not really the case - some people on some forum or other provided the solution back in the day and hopefully that will be replicated here
)
So I'd like to be able to reproduce the AHK functionality in Fastkeys and create website-specific messages etc. If this is possible, then I am going to write a blog post on how my professional group can use it in their work etc
GroupAdd, Browsers, ahk_exe chrome.exe
GroupAdd, Browsers, ahk_exe firefox.exe
GroupAdd, Browsers, ahk_exe msedge.exe
#IfWinActive ahk_group Browsers
^9::
WinGetActiveTitle, WinT
If InStr(WinT,"youtube")
MsgBox,
(LTrim
Captions - C (if available)
Forward 5 - Right arrow
Fullscreen - F
Mini player - I
... etc
)
Else If InStr(WinT,"calendar")
MsgBox,
(LTrim
Day - D
Week - W
Month - M
Year - Y
Sched - A
)
Return
Thanks Rob
ps I'm vaguely aware that FastKeys can call an AHK script and that would be a fall back position. Ideally can all be done in FKs which would make it simpler for the professional group
Thanks for that response. That works well but it's relatively straightforward for applications (either using the code you provided, or via using the Window field to make it context-specific)
What I find more difficult is making it context-specific based on a word in the browser URL
With the AHK script mentioned previously (https://www.johila.org/index.php/Johila ... ew/156/230), the approach was basically as further below (note - it may look like I half know what I'm doing but this is not really the case - some people on some forum or other provided the solution back in the day and hopefully that will be replicated here
So I'd like to be able to reproduce the AHK functionality in Fastkeys and create website-specific messages etc. If this is possible, then I am going to write a blog post on how my professional group can use it in their work etc
GroupAdd, Browsers, ahk_exe chrome.exe
GroupAdd, Browsers, ahk_exe firefox.exe
GroupAdd, Browsers, ahk_exe msedge.exe
#IfWinActive ahk_group Browsers
^9::
WinGetActiveTitle, WinT
If InStr(WinT,"youtube")
MsgBox,
(LTrim
Captions - C (if available)
Forward 5 - Right arrow
Fullscreen - F
Mini player - I
... etc
)
Else If InStr(WinT,"calendar")
MsgBox,
(LTrim
Day - D
Week - W
Month - M
Year - Y
Sched - A
)
Return
Thanks Rob
ps I'm vaguely aware that FastKeys can call an AHK script and that would be a fall back position. Ideally can all be done in FKs which would make it simpler for the professional group
-
- Posts: 8
- Joined: Oct 23rd, ’24, 06:42
Actually, ignore the previous post Tom. Think it was user error on my part - will post the working script when have finished playing around with it