I’m looking for a function in Scala that has similar functionality to getch. While using the console, I’d like to have my program display information based on what characters the user inputs (for example, if I was displaying a text, hitting n would show the next page, and p the previous). Right now I’m using readLine or readChar, but they require the user to hit Enter after each input, a bit annoying. Plus, in Eclipse plug-in’s interpreter, the input character is shown, although I guess that might be unavoidable.
I’m looking for a function in Scala that has similar functionality to getch. While
Share
scala.Console.readChar, aliased in in current incarnations of Scala asPredef.getCharis the most direct way.UPDATE
This time without the pesky
Enter: