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

Bug 477799

Summary: [GEF4 - FX] Support for KEY_TYPED events in FXTypeTool
Product: [Tools] GEF Reporter: Camille Letavernier <cletavernier>
Component: GEF FXAssignee: Matthias Wienand <matthias.wienand>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: matthias.wienand
Version: unspecified   
Target Milestone: 4.0.0 / 3.11.0 (Neon) M2   
Hardware: All   
OS: All   
Whiteboard:

Description Camille Letavernier CLA 2015-09-18 07:25:38 EDT
The FXTypeTool currently provides support for KeyPressed and KeyReleased events. However, these events only provide partial information about the key that has actually been pressed (Especially for non-ASCII keys).

While it is possible (and easy) to add custom Tools and Associated policies, I think it would make sense to get this support in GEF4 directly

Example of information about the KeyEvent (Difference between KEY_TYPED - currently not supported - and KEY_RELEASED):

---- Type ----
Text: ''
Char: 'é'
Code: 'UNDEFINED'
Letter: 'false'
Digit: 'false'
---- Released ----
Text: ''
Char: ' '
Code: 'UNDEFINED'
Letter: 'false'
Digit: 'false'

Note that in this case, the typed key doesn't have a corresponding Key Code, so it is (seems?) impossible to get any meaningful info in the KEY_RELEASED event
Comment 1 Matthias Wienand CLA 2015-09-18 07:55:31 EDT
Thank you for your feedback, support for KEY_TYPED events needs to be added. I will try to implement this on the neon branch as soon as possible, so that it will be published with the first milestone release for neon.
Comment 2 Matthias Wienand CLA 2015-09-25 10:40:45 EDT
I added support for KEY_TYPED events:
 - A new callback method within AbstractFXOnTypePolicy processes such events.
 - The FXTypeTool opens/closes a transaction for KEY_TYPED events if they happen outside of a press/release gesture, otherwise, the same transaction is used.

The code is published on the master branch. Therefore, I resolve this ticket as fixed for 3.11.0M2.

However, I am unsure if this implementation is sufficient, especially regarding the execution transaction. If you encounter any problems, feel free to reopen this ticket.