When I use the term inactive node below, what I mean is something that should not be able to interact with the user.
I built a general login screen similar to this:
One label, the typing label above the number keys takes both button input as well as keyboard input. With the way I have designed it up to this point, the label captures key presses from the keyboard and thus must maintain focus. The user is not expected to maintain focus in this label by clicking on it to get it to accept key presses.
The rest of the labels should be inactive: The "LOGIN" title, the "Enter Employee Number" message, and the date and time labels.
The buttons are all interactive: the number buttons, the back button, the clear button, the submit button, and the reset button. When these buttons are clicked, they edit the typing label text and pass focus back to it.
Lastly, there should be inactive containers holding these nodes.
When this screen is displayed, I want the user to be able to type numbers into the typing label even if they are intentionally trying to remove focus from the label. I could make every individual node on the screen node.mouseTransparent(boolean type);
or node.focusTraversable(boolean type)
, but it seems like there should be a better way to do it.
What is the best way to record key presses and manage focus in a screen that has both inactive and interactive nodes if the user is not expected to manage focus?
I thought to do something like this:
parent.mouseTransparent(true);
interactiveChild.mouseTransparent(false);
as I was hoping that the parent code would cover for the assortment of inactive children but the interactive child remains unclickable.