Closed GoogleCodeExporter closed 9 years ago
You need to check whether a key was actually pressed. A working input loop:
public static void main(String[] args) throws InterruptedException {
screen.startScreen();
while (true) {
Key key = screen.readInput();
if (key != null) {
if (key.getKind() == Key.Kind.Escape)
break;
}
Thread.sleep(1);
}
screen.stopScreen();
}
Original comment by unixprog@googlemail.com
on 13 Feb 2014 at 11:58
Yes, readInput() will return null if no key was pressed.
Original comment by mab...@gmail.com
on 16 Feb 2014 at 7:30
Original issue reported on code.google.com by
samfranc...@gmail.com
on 1 Feb 2014 at 10:36