N
N
nickchickin2015-05-17 14:29:47
Java
nickchickin, 2015-05-17 14:29:47

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

1 answer(s)
N
nickchickin, 2015-05-17
@nickchickin

www.darkcoding.net/software/non-blocking-console-i...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question