I've been trying to write a Java console program that can act upon arrow keys. I came across JLine library that claims to be able to do this.
I've tried a few times to use the JLine library to accomplish my goal, but have been unsuccessful in doing so.
ConsoleReader reader = new ConsoleReader(System.in, new PrintWriter(System.out));
Despite using ConsoleReader.readVirtualKey(), it still waits for enter key press.
I have also tried using
UnixTerminal terminal = (UnixTerminal) Terminal.setupTerminal();
terminal.readVirtualKey(System.in);
But this doesn't work either. It always waits for Enter key and does not show the arrow keys that I pressed before pressing the Enter key.
Could someone help me with this?