1

I'm trying to set the value of a variable to that of a keypress. It doesn't matter if the variable is set to the actual letter or the value of the letter. Just a way for the console to know which letter was pressed. AKA, I want to use WASD for Up, Down, Left, and Right. In order to do this, I need the console to accept my "WASD" inputs without being forced to hit enter each time I press a key. I'm using Replit as my IDE if that makes anything easier. (JAVA)

  • 1
    This question looks similar to https://stackoverflow.com/questions/1066318/how-to-read-a-single-char-from-the-console-in-java-as-the-user-types-it – cyberbrain Apr 13 '22 at 20:10
  • 2
    Does this answer your question? [How to read a single char from the console in Java (as the user types it)?](https://stackoverflow.com/questions/1066318/how-to-read-a-single-char-from-the-console-in-java-as-the-user-types-it) – Nicofisi Apr 13 '22 at 20:14

0 Answers0