0

I want to read user input from STDIN and process the preliminary input while the user is still typing.

gugelhüpf
  • 85
  • 2
  • 10

3 Answers3

1

A previous answer has some ruby code which enables this behaviour.

How to get a single character without pressing enter?

Community
  • 1
  • 1
Robert Duncan
  • 500
  • 3
  • 6
0

I would suggest reading something like http://ruby.runpaint.org/io

Mike
  • 364
  • 1
  • 9
0

Call STDIN.getc to get individual characters that the user types.

David Grayson
  • 84,103
  • 24
  • 152
  • 189