Quantcast
Channel: Latest Questions by Larry-Dietz
Viewing all articles
Browse latest Browse all 23

What key was pressed?

$
0
0

Is there any way to determine what key was pressed? Basically, what I want to do is this...

if (Input.anyKeyDown) {
     Debug.Log(keypress);
}

where keypress is the key that was pressed. I am only interested in alpha numeric keys, so I know I can do this by mapping the A key to "A" in the input preferences, etc... and a total of 36 if checks for all possible alpha numeric keys, but it seems there should be an easier way to do this.

So far I haven't come up with anything :(

Any help would be appreciated.

Thanks, -Larry


Viewing all articles
Browse latest Browse all 23

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>