Two Level Focus
daniel.blaukopf at oracle.com
Sun Nov 17 03:58:14 PST 2013
TWO_LEVEL_FOCUS is a feature developed for embedded platforms. However it can be enabled for desktop platforms by setting a system property in the way you describe. The kind of input device you have is exactly a match for two level focus. On embedded platforms the criterion for setting two level focus is that arrow and select keys are available but not a full PC keyboard.
Unfortunately there are a number of bugs currently filed against two level focus and we are not going to be fixing all of them for the upcoming Java 8 release. I do encourage you to file JIRAs on specific issues you run into so that we can track them in update releases. If you can include sample code and information on what JavaFX key codes are generated by your remote, that will help.
Yes, you can enable TWO_LEVEL_FOCUS on non-embedded platforms
On Nov 16, 2013, at 5:22 PM, John Hendrikx <hjohn at xs4all.nl> wrote:
> Hi list,
> I'm wondering how well the Conditional Feature "TWO_LEVEL_FOCUS" works, and if it is allowed to be used on non-embedded platforms.
> My main JavaFX project is basically a Windows/Linux application that runs without focus and is controlled with a remote control (no mouse or keyboard, although keyboard events are synthesized). This means I often run into problems related to the Window not having focus (controls donot show it, combobox drop downs close automatically, etc.)
> While fixing yet another of these problems in custom controls / skins, I ran into the Conditional Feature above, which quite accurately describes what I'm doing (remote control only has left/right/up/down and an OK button... and a back button) which qualifies as two level navigation I think. So I tried turning this on on Windows using:
> System.setProperty("com.sun.javafx.twoLevelFocus", "true");
> ...which I dug up out of Jira. This changes ComoBox control atleast to not respond to "up" and "down" keys when it has the focus, allowing me to move away from it. However, if you do click on it with the mouse (by selecting one of its items), focus is stuck there and cannot be moved anymore with just the 5 buttons.
> Anyway, this sounds like it is exactly what I need and may save me a lot of work, any more information about it is appreciated!
More information about the openjfx-dev