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.

1 Answer

1

yes there is :)

That's used in OnGUI. I'm looking for a way to do it outside if possible.

any particular reason?

@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, IMO.