- Home /
Keyboard-controlled dialog box.
If a game is running on a desktop without a mouse, how can I select and press a button in a dialog box that has two or more buttons? Is there any sample code or an Asset Store plugin that would do that? Thank you.
This is a design question and should go to the forums.
If you properly construct your dialog box with the UI introduced in Unity 4.6 then you don't need to do anything much. The arrow keys and the WASD keys are seen as the horizontal and vertical axis. So if you make a proper layout navigation amongst the buttons, then the keys will allow you to go from buttons to button and Enter or Space will select the highlighted button.
Thanks, it sounds like layout navigation is what I was looking for!
Your answer
Follow this Question
Related Questions
knowing when a ScrollView's scrollbar is focused 1 Answer
GUI.FocusControl() and TextFields - Prevent selection 1 Answer
[Android] Additional Dialog behaviour on focus loss 1 Answer
How do I change the value of an editor text field while it is selected from code 1 Answer
Problem using GUI.GetNameOfFocusedControl() with dynamic GUI 6 Answers