Recognize arrow keys in Java Scanner or Console application

前端 未结 1 920
一向
一向 2021-02-10 02:08

I am writing a Java application that uses both Scanner and Console to get input from the user. I would like to add command history support so that the

1条回答
  •  臣服心动
    2021-02-10 02:33

    Good question - +1'd. On Windows, I would SetConsoleMode to change the console to take raw input, but on *Nix it looks like there is more work involved. Unfortunately I don't have any code that I can show you right now, but have a look at this link and see if it helps.

    http://www.darkcoding.net/software/non-blocking-console-io-is-not-possible/

    0 讨论(0)
提交回复
热议问题