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

Impossible to display "Del" and "Insert" as MenuItem accelerator #1852

Open
guiv42 opened this issue Feb 24, 2025 · 0 comments
Open

Impossible to display "Del" and "Insert" as MenuItem accelerator #1852

guiv42 opened this issue Feb 24, 2025 · 0 comments

Comments

@guiv42
Copy link

guiv42 commented Feb 24, 2025

Describe the bug
In a Linux app, I'm using "Del" and "Insert" keys as accelerators for some menu items, and there's no way to have these keys displayed.

To Reproduce
Call org.eclipse.swt.widgets.MenuItem.setText(), with menu item text and accelerator separated by "\t" character as described in the documentation.

Expected behavior
In menu item, accelerator is displayed (right-aligned) next to menu item text.
E.g. it works normally for a simple accelerator like "X", but it cannot work with "Del" or "Insert" keys

Screenshots
None

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS

note: I did not check on other platforms, problem may be present as well.

  1. Additional OS info (e.g. OS version, Linux Desktop, etc)
    tested on Linux openSuse tumbleweed

  2. JRE/JDK version
    java-21-openjdk

Version since
Reproduced with SWT version 4.26.
Issue is still present in most recent code base when writing this (see analysis below)

Workaround (or) Additional context
Analysis of the current implementation, the only valid strings for an accelerator in a menu item are:

And "Del" and "Insert" key do not match these patterns, so such accelerators cannot be displayed.
I did not test explicitly, but issue should also be present for other keys (e.g. "Esc")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant