From: Luo Yong Date: 2006-10-01T11:39:48+09:00 Subject: Re: How to get a character from keyboard? On 10/1/06, Nebiru wrote: > > Luo Yong wrote: > > Hi all, > > > > I found that the STDIN.getc seem using a buffered input.It can't > > return anything until you enter a "\n". > > > > Is there any way to get a character directly from keyboard? > > > > Thanks. > > Not sure if this is quite what your looking for but I generally do > something like > def get_keypress > system "stty raw -echo" > STDIN.getc > ensure > system "stty -raw echo" > end > > key = get_keypress.chr > > > It works.Thank you very much. :) And thanks all.