If you want the user to enter a single key, you can use the getKey command, which doesn’t take any arguments, to get the ASCII code of the next keystroke. For example, if you enter
and then hit the A key, then the variable asciicode will have the value 65, which is the ASCII code of capital A.