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

Bug 399989

Summary: [KeyEvents] The state of the modifier key is not updated for cancelled keys.
Product: [RT] RAP Reporter: Jacek Wozniak <jacek.wozniak>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: tbuschto
Version: 2.0   
Target Milestone: 2.1 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
A snippet to reproduce the issue. none

Description Jacek Wozniak CLA 2013-02-05 10:19:55 EST
Created attachment 226573 [details]
A snippet to reproduce the issue.

If I press a key with a modifier (e.g. Shift+F3) and then the same key without the modifier (F3), the key event's stateMask is not updated.
It holds the previous value (Shift). 

This bug occurs for cancelled keys (RWT.CANCEL_KEYS).
Pressing some other key or even clicking a mouse updates the state mask so the next key event has correct modifier value.

I can reproduce it in RAP 2.0 RC2, RC1 using key/traverse listeners and display key filters, with modifiers: Alt/Shift/Ctrl. 
It works fine in RAP 1.5.

To reproduce, run the attached snippet:

1. Press F3, event.stateMask = 0 - Ok.
2. Press Shift+F3, event.stateMask = 131072 - Ok.
3. Press F3, event.stateMask = 131072 - Not Ok.

I tested with browsers: IE9, FF, Chrome.
Comment 1 Ivan Furnadjiev CLA 2013-02-11 05:43:03 EST
I can reproduce it with the attached snippet (but not always). Change priority to P2 as it is a regression.
Comment 2 Tim Buschtoens CLA 2013-02-18 06:29:01 EST
Fixed with commit bc7b3b12cba3713821cb7c9cc9fb603276d993ed

The modifier values used were the ones cached in EventUtil.js, which are meant more for mouse events.
Comment 3 Ivan Furnadjiev CLA 2013-02-18 06:51:27 EST
Wrong commit id. Here is the correct one: 332e1385b5ff2160cf3883ff72ae52295a4e7614.