From: "Thomas B." Date: 2008-09-05T05:44:32+09:00 Subject: Re: How to read a character at a time from STDIN without nee Kenneth McDonald wrote: > In the following bit of code: > > print STDIN.getc > STDOUT.flush > > The code for whatever key I type isn't actually printed out until I go > on to hit the return key. How can I have it printed as soon as I type > a character key? > > Thanks, > Ken It's not in Ruby standard. Under Windows you can do it like this: def read_char require "Win32API" Win32API.new("crtdll", "_getch", [], "L").Call end Found here: http://www.rubyquiz.com/quiz5.html TPR. -- Posted via http://www.ruby-forum.com/.