OverviewUI Key Navigation component makes it possible to add keyboard and controller-based navigation to your UIs.

By default it's not possible to navigate the UI using keyboard, joystick or a 360 controller because without a touch or mouse input it's not immediately clear what should be receiving the events. To remedy this situation, NGUI treats the currently selected object as the object that will receive the events, and the
Key Navigation component makes it possible to change the selection based on user input -- such as pressing arrow keys on the keyboard or using a thumb stick on the 360 controller.
To begin, simply attach the
UIKeyNavigation component to the widgets that should respond to controller events. This generally means all your buttons, sliders, toggles, popup lists, etc. If your game is not meant to be controlled by mouse or touch, it's also a good idea to ensure that one of the navigation scripts has an active
Starts Selected flag so that it becomes selected (and thus -- controllable) from the very beginning.
The script will automatically determine what should get selected when the arrow keys get pressed, selecting the next active object that has
UIKeyNavigation attached in the direction of movement. If you want to restrict movement, use the
Constraint field. "None" means no restriction on movement. "Vertical" and "Horizontal" limit the movement only to the axis of your choice. Setting the Constraint to "Explicit" will disable the automatic detection altogether, and only the explicitly specified values under the
Override section will be used.
Speaking of that,
Override is what ultimately "forces" the value to be what you chose it. If an override value is set, that value will always be used regardless of the Constraint setting. So if you wanted to fine-tune the navigation on specific buttons to select something that may not be obvious to the system, you would do it by setting the appropriate override fields.
Last but not least, if you have a button that opens a new window on click, you may want to set the
Select on Click field to a control inside that window so that the selection is moved accordingly. In the
Controller Input example scene the "Options" button shows the Options menu and also gives focus to a button inside of it.
Pro-TipYou don't need to set the Override fields unless pressing the key does not result in the correct widget being selected.
Class Documentationhttp://tasharen.com/ngui/docs/class_u_i_key_navigation.htmlIf you have a question regarding this component or would like me to clarify something, just post a reply here.