Bug 570998 - [win32] First character of menu not always ignored as mnemonic
Summary: [win32] First character of menu not always ignored as mnemonic
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.18   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-07 10:18 EST by Rolf Theunissen CLA
Modified: 2021-02-12 02:13 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Theunissen CLA 2021-02-07 10:18:30 EST
On windows the first character of a menu item on the menu bar is used as mnemonic, when no mnemonic is specified. This mnemonic is not underlined.
SWT suppresses this behavior in Control#WM_SYSCOMMAND, such that in Eclipse the first character is not used as mnemonic.

However, this behavior is only suppressed when SWT.KeyDown or SWT.KeyUp is hooked. Therefore, depending on the focus the mnemonic is ignored or not.
To test this behavior in Eclipse, add a menu item without a mnemonic (or add a keybinding that suppresses the mnemonic). Then when an empty outline view has focus the first character is enabled, when an text editor has focus the character is disabled.

Furthermore, the first character mnemonic is always enabled when pressing Alt followed by <key> (as two key presses).
Comment 1 Rolf Theunissen CLA 2021-02-12 02:13:14 EST
To test this bug, take the testcase from Bug 346475 Comment 7. Then observe the different behavior when the keylistener is add or not.