How to navigate a GUI with arrows or single letters? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Wpq
Posts: 14
Joined: 02 Mar 2021, 04:15
Location: France

How to navigate a GUI with arrows or single letters?

Post by Wpq » 05 Jul 2022, 02:26

I decided to build a GUI popup to quickly create an Obsidian note. I expect three possible cases: a daily note (which is created via a single hotkey in Obsidian), a "named note" for which I will provide a title (in the AHK GUI) and open it, and a hotkey to pop up the search menu in Obsidian.

Since I plan to call the GUI via a `Win-N` combination, I would prefer to keep my fingers on the keyboard for the next actions. I was hoping for either or both of
  • letters to press to jump to one of the positions
  • arrow keys-based movements
Unfortunately, it would seem (https://lexikos.github.io/v2/docs/objects/Gui.htm#Navigate) that only the TAB key is possible?
A GUI window may be navigated via Tab, which moves keyboard focus to the next input-capable control
Is any of the navigations above possible?

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

Re: How to navigate a GUI with arrows or single letters?  Topic is solved

Post by mikeyww » 05 Jul 2022, 05:06

You can add as many new hotkeys as you like, and assign actions to them. A menu can also be attached to a GUI and can have its own hotkeys.

Code: Select all

Menu, gui, Add, Edit&2, !2
Gui, Font, s10
Gui, Menu, gui
Gui, Add, Edit, vv1 w250
Gui, Add, Edit, vv2 wp
Gui, Add, Edit, vv3 wp
Gui, Show,, Test

#IfWinActive Test ahk_class AutoHotkeyGUI
!1::
!2::
; !3::GuiControl, Focus, % "v" SubStr(A_ThisLabel, 2)
!3::GuiControl, Focus, % StrReplace(A_ThisLabel, "!", "Edit")
#IfWinActive

Post Reply

Return to “Ask for Help (v1)”