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-
robpenfold
- Posts: 11
- 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-
robpenfold
- Posts: 11
- 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
-
robpenfold
- Posts: 11
- 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
-
robpenfold
- Posts: 11
- Joined: Oct 23rd, ’24, 06:42
Have found an approach that works with both programs & websites to display context sensitive keyboard shortcuts (or any other useful information) which I find very handy
Further below is an entry for a program (Notepad++).
Shortcuts > Command > Window field has ahk_class Notepad++ (via right click on FastKeys icon > Windows information) for context sensitive display of information
Found that this approach will also work with websites by using a word or phrase from the tab title
So for example with the Google Calendar site, you can just put google calendar in the Window field. Or youtube in the Window field for the Youtube site and so on
Using version 6.04 (have a slight feeling this wasn't working on version 5 but not totally sure about that)
Possibly / probably you could combine the various scripts into one but personally I like to keep them all separate - that way it's very quick and easy to update the specific script in question
Also keep the same shortcut for all programs / sites (Ctrl 9) as makes it universal / just one shortcut to remember
The keyboard shortcut display can be dismissed by pressing Esc twice (this script comes preinstalled with FastKeys)
Overall I find being able to do this in FastKeys very productive as it's one keyboard shortcut to remember, and then you have information about how to use a program or app that you have put in yourself as relevant (ie you have customized it rather than using the default in the app or program which might have way too much or not be organised in such a way that makes sense to you etc)
NOTE - With the Notepad++ script below, when it's in Fastkeys the content looks more like two columns:
The topic on the left and the keyboard shortcut to the right
However when posting it here all the spacing is removed so looks more like a solid block
(Tried to post an image but didn't work - can see original script layout at https://ibb.co/yB8CVJ4M and output at https://ibb.co/jkZzH0XP)
Any suggestion on how to make aligning content easier rather than the current trial & error approach? Seems to depend on the length of the content somehow. Not overly important - just if you had any tips for nice GUI display that is simple
gui, myshortcuts:default
gui, destroy
text:="
(
NOTEPAD++
HTML Alt L > H > HTML
Plugins Plugins > Plugins Admin
Pretty Print Alt Spacebar
Preview Ctrl Shft h or Alt V > View Current File in > Chrome
Shortcuts Run > Modify Shortcuts
Snippets Alt X to filter box then type
Snippet (Add) Right click > duplicate. Then right click the duplicate and edit
Tabs Ctrl Tab will jump between Notepad++ tabs
)"
gui, font, s12, Courier UI
gui, add, text, w800, % text
gui, show
return
Further below is an entry for a program (Notepad++).
Shortcuts > Command > Window field has ahk_class Notepad++ (via right click on FastKeys icon > Windows information) for context sensitive display of information
Found that this approach will also work with websites by using a word or phrase from the tab title
So for example with the Google Calendar site, you can just put google calendar in the Window field. Or youtube in the Window field for the Youtube site and so on
Using version 6.04 (have a slight feeling this wasn't working on version 5 but not totally sure about that)
Possibly / probably you could combine the various scripts into one but personally I like to keep them all separate - that way it's very quick and easy to update the specific script in question
Also keep the same shortcut for all programs / sites (Ctrl 9) as makes it universal / just one shortcut to remember
The keyboard shortcut display can be dismissed by pressing Esc twice (this script comes preinstalled with FastKeys)
Overall I find being able to do this in FastKeys very productive as it's one keyboard shortcut to remember, and then you have information about how to use a program or app that you have put in yourself as relevant (ie you have customized it rather than using the default in the app or program which might have way too much or not be organised in such a way that makes sense to you etc)
NOTE - With the Notepad++ script below, when it's in Fastkeys the content looks more like two columns:
The topic on the left and the keyboard shortcut to the right
However when posting it here all the spacing is removed so looks more like a solid block
(Tried to post an image but didn't work - can see original script layout at https://ibb.co/yB8CVJ4M and output at https://ibb.co/jkZzH0XP)
gui, myshortcuts:default
gui, destroy
text:="
(
NOTEPAD++
HTML Alt L > H > HTML
Plugins Plugins > Plugins Admin
Pretty Print Alt Spacebar
Preview Ctrl Shft h or Alt V > View Current File in > Chrome
Shortcuts Run > Modify Shortcuts
Snippets Alt X to filter box then type
Snippet (Add) Right click > duplicate. Then right click the duplicate and edit
Tabs Ctrl Tab will jump between Notepad++ tabs
)"
gui, font, s12, Courier UI
gui, add, text, w800, % text
gui, show
return
