-
Notifications
You must be signed in to change notification settings - Fork 166
Impossible to display "Del" and "Insert" as MenuItem accelerator #1852
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
Comments
Yes, this is a problem since years. |
Thank you for your answer.
Hypothesis :
I admit that a comparison with a hard-coded string is not ideal, but could that be a workaround? |
@guiv42 Your investigation was right. I've added more words and they work on my test system. |
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:
note: I did not check on other platforms, problem may be present as well.
Additional OS info (e.g. OS version, Linux Desktop, etc)
tested on Linux openSuse tumbleweed
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")
The text was updated successfully, but these errors were encountered: