- Home /
How to make a Key Listener in unity
Hi all, I am wondering how to go about making a key listener. What I mean is:
the program prompts you to press any key (I have that), then you press any key on the keyboard, and it responds saying "you have pressed x" where x is the key you pressed.
I've tried using the input.anykey bool to then return the getkey command as a string... but that didn't work at all.
any help would be much appreciated
ps. this would be really useful in situations where the player needs to reassign his controls to better customize it for himself.
Please post your code. You know about the Input $$anonymous$$anager, where the user can reassign their keys, right?
Answer by DaveA · Nov 06, 2012 at 10:24 PM
thanks for the reference, i was able to use the default code, and it works like a charm!
Please mark this as 'answered' by hitting the checkmark to the left here