Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Arshia001 · Aug 09, 2011 at 05:35 PM · guikeyboard

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?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Chris D · Aug 09, 2011 at 05:46 PM 0
Share

What exactly are you trying to do?

avatar image Arshia001 · Aug 10, 2011 at 07:12 AM 0
Share

$$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.

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

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

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Chris D · Aug 09, 2011 at 07:39 PM 0
Share

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.

avatar image Arshia001 · Aug 10, 2011 at 07:09 AM 0
Share

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.

avatar image
1

Answer by Molix · Aug 09, 2011 at 08:13 PM

See Event.

e.g. (from docs)

 void OnGUI()
 {
   Event e = Event.current;
   if( e.isKey )
   {
     Debug.Log("Detected character: " + e.character);
   }
 }


Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges