I've been searching for a long time now and I wanted to know, How can I code that things will happens when I press on a specific key, (e.g. W). I found many threads that help in this section with general keys like the delete key or the spacebar and some keyDown theKey, but how do I define "theKey"? Please help, FESFEW
For the alphanumeric keys you can use as follows:
KeyDown is an event that will be generated each time the user presses a keyboard symbol (not the function keys), the thekey parameter will contain the symbol of the pressed key.
On the other hand, if you want to differentiate capital letters you must set the CaseSensitive property to TRUE
The rawKeyDown property works similarly, but instead of coming in the parameter, the symbol of the pressed key what you will get will be the code of the pressed key including the function keys like shift, F# etc.
Constants will be very useful to help make your code more readable, adding constants to previous code will look like this (note that the uppercase keys have codes other than the lowercase ):
You can also use this script in the card script to show the code of the key you press: