How Do I Instantly Read a Key Press In The Java Console? (No "Enter" Key Pressed)

389 Views Asked by At

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)

0

There are 0 best solutions below