Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: make menu-bar keyboard navigable #44

Open
arxanas opened this issue May 7, 2024 · 9 comments
Open

feature: make menu-bar keyboard navigable #44

arxanas opened this issue May 7, 2024 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@arxanas
Copy link
Owner

arxanas commented May 7, 2024

Typical GUIs let you open menu bar items using the keyboard. It would be nice if the menu bar items could be at least expanded using the keyboard.

This was originally requested on Discord: https://discord.com/channels/968932220549103686/1235711594185621585

@arxanas arxanas added enhancement New feature or request good first issue Good for newcomers labels May 7, 2024
@emesterhazy
Copy link
Collaborator

Yeah, this would be great. I used scm-record for a few months before I realized that I could click on the menu bars to learn the keybindings and do things.

We might want to show the keyboard shortcut in parentheses next to the menu item to make it clear how to expand it with the keyboard.

Perhaps we could just use numbers starting from 1? For example:

[File (1)] [Edit (2)] [Select (3)] [View (4)]

@arxanas
Copy link
Owner Author

arxanas commented Jun 18, 2024

Perhaps we could just use numbers starting from 1? For example:

My dream would be to one day support multi-way splits where you could assign a change to the nth split by pressing the corresponding number key 😍. Perhaps we could use the F-keys for the menu items, similarly to GUI applications?

@emesterhazy
Copy link
Collaborator

That should work too :)

@essiene
Copy link

essiene commented Sep 22, 2024

we could take a page from nano[1]. It has a footer palette that shows the most important keyboard shortcuts. We could have something for just the main menu items and the rest will be visible once the menu is activated.

[File (1)] [Edit (2)] [Select (3)] [View (4)]

fwiw, I'm more used to seeing Menu type interfaces use either CTRL+ or MOD+ for these, instead of grabbing the number keys. So CTRL+F or 'MOD+F' to open the file menu would seem less surprising for me, plus I may be able to guess it without referring to docs if 'F' were in bold or underlined, or had some other hint.

Perhaps we could use the F-keys for the menu items, similarly to GUI applications?

I'm personally not familiar with GUI apps that use F-keys for the menu? Though I have to confess my GUI apps these days is really just a browser.

Also, some keyboards make the F-keys a pain to access via secondary combos (or don't even label them... I'm looking at your Chromebooks).

[1] - https://www.nano-editor.org/

@WhyNotHugo
Copy link

The standard shortcut for accessing menubars for the last several decades is Alt. Opening File would be Alt+f. I think it's best to stick to the standard. I honestly don't think I've ever seen any exception since the days of MS-DOS until today.

@arxanas
Copy link
Owner Author

arxanas commented Dec 13, 2024

The standard shortcut for accessing menubars for the last several decades is Alt. Opening File would be Alt+f. I think it's best to stick to the standard. I honestly don't think I've ever seen any exception since the days of MS-DOS until today.

For posterity/documentation purposes, can you/others provide a reference for the proposed feature/UI paradigm? (For my own suggestion, I didn't find a reference for my own suggestion of f-keys being used for menu bar shortcuts, unfortunately.)

  • I certainly recall something like alt-f for Windows.
    • Possibly we also have to underline the associated f in the File text to complete this UI convention?
    • Is this only for DOS/Windows?
    • Do macOS/Linux have any established keyboard shortcuts here?
  • Pragmatically speaking: I've had a lot of issues with TUI applications not handling alt-X shortcuts, with some misconfiguration meaning that meta-X happens instead, or vice-versa.
    • Before committing to alt-X shortcuts, I'd like to have some confidence that it works on a variety of terminal configurations.
    • Unfortunately: I don't have enough personal experience or knowledge to say anything with confidence about the behavior of various terminal emulators.

Ultimately: I don't think the menu bar is even an ideal system:

@WhyNotHugo
Copy link

The Alt+letter style is for DOS, Windows, and Linux. Like I said, this combination is pretty ubiquitous, I don't think I've ever seen applications with a menubar and a different shortcut to access it.

I haven't used windows in a while (I think that last one I actively used was Windows 7), but generally all the windows built-in apps follows this pattern (e.g.: notepad, paint, internet explorer, file explorer, etc). MS Office had the same. A quick online search indicates that Adobe software does the same.

GTK2 and GTK3 applications followed the same pattern (GTK4 has no menusbars). Qt applications too (I just double checked with a few, including mumble).

Finally, even Firefox will now show the menubar if you press Alt, and will poen the File menu if I press Alt+f

@WhyNotHugo
Copy link

macOS doesn't open menus with Alt. macOS has no Alt key. A quick online search indicates that Control+F2 will focus the menubar. But note that macOS uses an external menubar, so you don't want to override this shortcut (nor can you).

@WhyNotHugo
Copy link

Ultimately: I don't think the menu bar is even an ideal system:

It's possible that it isn't. A menubar is mostly idea if you have a large amount of actions that are grouped in a way that aligns with it, and need a way for them to all be discoverable. It's only a good fit if you expect to eventually have more and more actions.

I think a searchable command pallette is not a good fit. It is good interface when you have many actions, and the user knows what they're called or how to look for them (or when actions are user-created). Actions are not discoverable at all; the user needs to know what they're called ahead of time.

If there will only be 7 to 14 actions, using a bar at the bottom like nano is not a bad idea; all shortcuts can be shown on screen at all times. But if the amount of actions ever grows beyond that, you start to need three rows of actions which is a bit much. Of course, a second layer of actions can be hidden behind a ? mapping which shows a screen with their shortcuts -- this has the downside of them not being mouse-accessible at all, but I can't imagine power users using advanced actions complaining about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants