Answer the question
In order to leave comments, you need to log in
How to catch the ESC key in the Java console?
@Override
public void run() {
while (true) {
try {
if (System.in.read() == 'q') {
// actions
}
} catch (IOException e) {
e.printStackTrace();
}
}
but instead of q it is necessary that there be an ESC key
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question