Bug 528147

Summary: KeyEvent#isShiftDown() and #isControlDown() never return true for an initial key press event
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 5.0.1   
Target Milestone: ---   
Hardware: All   
OS: Mac OS X   
Whiteboard:

Description Matthias Wienand CLA 2017-12-05 06:53:11 EST
Currently, the TraverseFocusOnTypeHandler and SelectFocusedOnTypeHandler query KeyEvent#isShiftDown() and #isControlDown() for determining the focus traversal direction or the selection mode, respectively.

However, the #isShiftDown() and #isControlDown() methods never return true for the initial key press event, because all key codes except for SPACE and TAB are discarded.

In order to be able to traverse focus in both directions (instead of only forwards), as well as appending to the current selection (instead of replacing it), the SHIFT and CONTROL modifiers need to be checked in the press(KeyEvent) callback method instead of the initialPress(KeyEvent) callback method.