- Home /
Using keyboard with the GUI system
I'll just make this short. From all I've gathered so far, there isn't a way to use the keyboard with Unity's GUI system. However, just to be sure, am I right?
$$anonymous$$ake a menu that works with the keyboard rather than the mouse! Having to use the mouse with in-game menus is such a pain.
Answer by matyicsapo · Aug 09, 2011 at 07:29 PM
I thought that GUIUtility could help, but it either can't or I don't understand it. Either way, using custom GUIStyle-s that don't show like visual feedback that the mouse is over the element so no 2 elements appear active at the same time for example. And for the inactive elements I used another style. The keyboard controls were done simply using the Input class, with all the elements stored in an array in an order that represented their order in which control should jump between them. Used custom structs, function references (delegates in C#) and some other stuff. Anyway I think it was a good idea though still a bit hardcoded. Also I haven't implemented functionality for all the various kinds of GUIElements provided. Haven't made (it) into a custom GUI kit (yet), but for a 1-time use it was sufficient and pretty doable.
Check out the many free GUI extensions, they might also have sg. wise to say about this.
I don't whether the guys at Unity plan to do anything about the whole GUI creation. If they do, then you could just wait :D
It's a common request and is, it would appear, being addressed:
http://feedback.unity3d.com/forums/15792-unity
The #2 requested feature as of now.
Yep, that's what we're gonna have to do... A real pain, though. $$anonymous$$eeps re$$anonymous$$ding me of UD$$anonymous$$'s sweeeeet GUI editor! :D tnx for the info anyway.
Your answer
Follow this Question
Related Questions
How to Select a Focus Control? 1 Answer
Issue with GUI.TextArea keyboard on iPhone 0 Answers
Controlling Pause Menu with Keyboard 2 Answers
Assign keystrokes to GUI button 2 Answers
Oculus Rift virtual keyboard 0 Answers