Bertram Scharpf wrote: > Hi, > > Am Sonntag, 26. Aug 2007, 07:00:06 +0900 schrieb William James: >> On Aug 25, 3:05 pm, "Barr, Keith" <keith.b... / lmco.com> wrote: >> > I have a menu that I would like users to respond to >> > simply by entering a single character. >> >> def getkey >> select( [$stdin], nil, nil, 0.01 ) ? c = $stdin.getc : c = nil >> end > > Why `c=ยด? Why twice? > > It doesn't work here; it still waits for the enter key. > > I doubt whether there is any other way than using termios. > > Bertram It means if select( [$stdin], nil, nil, 0.01 ) return true, then c = $stdin.getc; otherwise c = nil. -- Posted via http://www.ruby-forum.com/.