JDK-8090584 : Support standard for UP / DOWN remapping
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2014-06-12
  • Updated: 2024-11-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
In many applications it may be necessary to use the UP and DOWN arrow keys for other purposes than navigating to the next focusable control. However, avoiding focus traversal is – as far as I can tell – not trivial to achieve.

Adding an EventHandler to consume the UP and DOWN key strokes does not help, since the focus traversal occurs before a custom key event handler is invoked.

Several developers have come accross this problem, and some have solved it by using an EventFilter to fool JavaFX into thinking that UP strokes are SHIFT+UP strokes and vice versa. One such example is documented here:
http://stackoverflow.com/questions/19625218/javafx-scrolling-vs-focus-traversal-with-arrow-keys

Although this approach may work, I consider it very elaborate and prone to future errors as JavaFX changes over time.

I suggest adding a feature to allow disabling of certain focus navigation keys per control, so that I can – for instance – change the selected element in a popup list when the user hits DOWN in a TextField of mine.
Comments
I have found a useful, temporary work around: By subclassing ComboBox instead of TextField, the problem goes away. This is a less than optimal solution, but it does solve parts of the issue.
16-06-2014