Unable to detect KeyPress in java with console, I think. Although there is a way to do this initially using JNI. You can get the source code example here
As for continuous input until break, you can do this with a simple while loop:
while((input = in.readLine()) != null){ System.out.println(); System.out.print("What you typed in: " + input); }
Kris source share