James Gray
9/20/2006 12:56:00 PM
On Sep 19, 2006, at 11:33 PM, Eero Saynatkari wrote:
> Nguyen Huu Bach wrote:
>> This is a simple way to achieve that. Maybe there are others
>>
>> def read_char
> # Save previous state
> old = `stty -g`
>> system "stty raw -echo"
>> STDIN.getc
>> ensure
> system "stty #{old}"
>> end
>>
>> good luck
>
> Might be better to use Termios or Curses, though.
Or use HighLine which handles all these details for you.
James Edward Gray II