When opening a context menu ("Popup"), the accelerator keys are not underlined, unless they are opened while the Alt key is being pressed (either Alt+Right-click or after defining a new shortcut Alt+<something> for "Popup"). Another trick that works in some cases (e.g. for the editor's context menu) is to press&release Alt (so the focus moves to the main menu bar and accelerators are highlighted there) and then opening the context menu using the CONTEXT_MENU key. Note that pressing Alt while a context menu is open closes the context menu, so having Alt trigger the underlining doesn't usefully work for context menus.
Context menus should always show the accelerator keys underlined when they have been opened using the keyboard. Otherwise it's difficult to find out what the accelerator key is for a given item, or even that there are accelerator keys at all.
Unless I am mistaken, there is some UI reason for not underlaying anything in popup menu. Ondřej can correct me.
Sorry, but how can this be? This is a crucial accessibility issue.
How is one supposed to use the accelerator keys if they are not highlighted?
In all Windows applications I use that have context menus with accelerator keys, the keys are underlined when opening the context menu with the keyboard.
I think you are referring to mnemonics, not accelerators (~ shortcuts)? If so, then I don't know about 6.8, but they are intentionally suppressed in context menus in 7.0: bug #83952.
(In reply to comment #3)
> How is one supposed to use the accelerator keys if they are not highlighted?
You're not. You can select a menu item using the arrow keys; or invoke an accelerator, where one exists.
Yes, I mean mnemonics aka "access keys", sorry for the confusion.
There are the following two problems:
1) Most context menu entries don't have a mnemonic (unlike most main menu entries). Having to use the arrow keys is a real pain for keyboard users. I avoid using the mouse because of RSI, but having to use the arrow keys in context menus also strains my RSI.
2) Mnemonics are not shown underlined in context menus (unlike in main menus) when opened by keyboard, so even if a context menu entry happens to have a mnemonic there's no way to see it.
I don't understand the rationale in issue #83952 of suppressing context menu mnemonics in 7.0 completely. Can you please elaborate on this?
On Windows, there is the convention that if a menu entry has no explicit mnemonic, then the first character of the label acts as a menmonic (e.g. see the Windows Start menu). This ensures that all menu entries have mnemonics (even if they sometimes conflict). It would be great if NetBeans adopted this on its menus (and would display mnemonics underlined in context menus).
I know that those who use mnemonics in menus are in the minority, but for those who do it's an important usability (and sometimes health) issue. There's a reason why it's part of the Windows UX Guidelines : "Assign access keys to all menu items so that users who prefer working with the keyboard have the same ability to navigate your program as users who work with the mouse. [...] Assign access keys to all menu items. No exceptions."
(In reply to comment #5)
> I don't understand the rationale in issue #83952 of suppressing context menu
> mnemonics in 7.0 completely. Can you please elaborate on this?
There was no agreement in the discussion of that issue that mnemonics would be useful in context menus, and there was no one willing to step up to the task of reviewing every context menu in the IDE to ensure that all of its items specified a meaningful mnemonic with minimal conflicts. Rather than leave a handful of mnemonics in place in some menus, which looked very bad, it was decided to just suppress them all. You can bring it up on the mailing lists; I have no strong opinion on the matter.
True, NetBeans IDE does not want mnemonics in popup menu these days, but some applications built on top of NetBeans platform may want to show the mnemonics in popup menu anyway.
Here is a small branding change that provides new USE_MNENOMICS=always key API. The patch also contains changes to make sure top component's menu can have mnemonics on.
Created attachment 108774 [details]
USE_MNENOMICS & changes in core.windows
Created attachment 108775 [details]
Hg bundle with sample testing application
As a tracking matter, I do not think it is good to repurpose this issue - about restoring mnemonics to context menus in the NB IDE, including (I presume) actually defining important ones where they would be missing - to something else entirely, which is defining an API for other applications to enable mnemonic display where available: implementing the API would not address any NB IDE user need. So please file a separate API review issue for the latter, probably blocking this one.