From: Eric Armstrong Date: 2006-08-02T06:51:45+09:00 Subject: Re: Loop Timing and Constant Input James Edward Gray II wrote: > On Jul 31, 2006, at 10:51 PM, Eric Armstrong wrote: > >> a) There doesn't seem to be any equivalent for the >> windows Kbhit. That's the nice little operation >> that lets you ask whether there is a character >> in the buffer, and proceed if there isn't any. > > Would the standard io/wait library work for this? > It adds a ready?() method to IO objects. > ooohhhh. Dude! You're giving me chills! Found the API docs here: http://stdlib.rubyonrails.org/libdoc/io/wait/rdoc/index.html What do I do to use it? This: require 'io/wait' Or is it something like this: require 'io/wait/lib/nonblock' Once I get the require clause right, that adds the methods to the IO class. Then it's a matter of figuring out how to use it with Curses. I suppose I can do this: if $stdin.ready? then c = stdscr.getch ... Yes? And speaking of curses... I found this nicely formatted rdoc site in New Zealand: http://www.cs.auckland.ac.nz/references/ruby/stdlib/libdoc/curses/rdoc/ The fascinating thing is, it mentions about twice as many APIs as the standard site: http://www.ruby-doc.org/stdlib/ The NZ TOC page says it was generated in Summer of 2004, so it's doubtful that it's for 1.9 (unless the date is wrong). I wonder what's going on?