Is JavaFX keyboard event handling too rigid?
Randahl Fink Isaksen
randahl at rockit.dk
Fri Jun 13 08:11:50 UTC 2014
I have noticed that quite many developers are having trouble avoiding triggering of focus navigation occurring when a user presses the UP and DOWN arrow keys. From a number of different forum posts I have seen how people are jumping through hoops to avoid this.
I myself have the challenge, that I need to use the UP and DOWN keys for changing the selected autocompletion in a text field, and it seems that no matter how greedily I try to consume or filter out these KeyEvents, JavaFX still insists on moving the focus from one field to the next.
This got me thinking: Why is JavaFX keyboard event handling so rigid? If you implement a control which listens for keyboard events on itself and does some cool stuff, that is fine. But once you implement a subclass that wishes to replace some of that behaviour you are in trouble, because once the EventHandlers are registered, there is no public API to replace them.
Is this a conscious design decision? Is it something that I should file a feature request on, or have I overlooked a part of the API which could be used here?
More information about the openjfx-dev