I'd like to catch if user enters/deletes character from console before clicking 'enter'. Is simply way to do that in Java? Thank you for any tips
Asked
Active
Viewed 19 times
0
-
No, you cannot. The terminal emulator decides when to submit data to the program. – Boris the Spider Apr 06 '15 at 11:47
-
1No, there is no easy way. The only way to do is to use a (J)TextArea, create TextAreaInput/OutputStreams, and use System.setOut/In/Err – ControlAltDel Apr 06 '15 at 11:47
-
Not sure but I think KeyListeners can be used? http://stackoverflow.com/questions/15693904/java-keylistener-keytyped-backspace-esc-as-input – Sakshi Singla Apr 06 '15 at 11:49