Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 532416

Summary: An accelerator "F4" on menuitem invoked by Enter (CR) key when KeyListener presents
Product: [RT] RAP Reporter: Hiromu Hota <hiromu.hota>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 3.5 M3   
Hardware: PC   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/119373
https://git.eclipse.org/c/rap/org.eclipse.rap.git/commit/?id=a5f0e8dc80d394283da24b30ea66510449a8a764
Whiteboard:
Attachments:
Description Flags
Demo class to reproduce the bug none

Description Hiromu Hota CLA 2018-03-13 18:48:43 EDT
Created attachment 273111 [details]
Demo class to reproduce the bug

My app has a menu with accelerator of F4 and a canvas with KeyListener.
The issue is that this menu is invoked even when Enter (CR) key is pressed-down.

I found that when these keys are pressed-down the following KeyEvent is issued:
F4 (event.type=SWT.KeyDown, event.character='' (0), event.keyCode=16777229 (0x100000D), stateMask=0)
Enter=CR (event.type=SWT.KeyDown, event.character='\r', event.keyCode=13 (0xD), stateMask=0)
F4(0x100000D) can be (char) casted to 0xD, then matches Enter (CR).

To reproduce the bug, one app has to have some widget with KeyListener attached.
Comment 1 Eclipse Genie CLA 2018-03-13 19:26:57 EDT
New Gerrit change created: https://git.eclipse.org/r/119373