Is there anything simple like ReadKey
from .NET/Mono for Java? I need to read input from the console, but I also need to be notified that user is typing (aka there is some input in the prompt, but user has not yet submitted the line by pressing enter key).
In .NET you can scan for keys by calling blocking System.Console.ReadKey
but I was unable to find anything like that in Java.
I can't understand there is no way to do such a simple and elementary thing. Or am I missing something?
Update
I tried experimenting with jline but was unable to make it working (at least not on MacOS, which is my base system. I am not sure whether it works on other platforms).
Jline seems to me as absolutely unstable library, that is changing absolutely everything from version to version.
Does anybody have working example with jline, that is able to respond on console input? I supposed that readVirtualKey
should do the job, but it's been removed in last versions of jline and when I tried it with older versions, it worked like regular System.in.read()