- Home /
Anyway to get what key is down?
Is there anyway to get what key is pressed in a frame, outside of using Events in OnGUI or a huge switch statement with all keys.
Input.inputString only returns ascii characters and not arrow keys.
Answer by AngryOldMan · Mar 31, 2011 at 03:19 AM
yes there is :)
That's used in OnGUI. I'm looking for a way to do it outside if possible.
@SirGive: I don't know what the OP needs it for, but I've had need for this before as part of a custom input manager system. @The OP: When I did this, I just looped through all the key codes. Obviously that's not terribly efficient, but it's ok for e.g. an input configuration screen, I$$anonymous$$O.
Your answer
Follow this Question
Related Questions
Input Manager (From string to keycode) 3 Answers
Create GUIText by pressing key 1 Answer
Check the latest key pressed? 2 Answers
Perform event only once on keypress 1 Answer
Key not recognized 2 Answers