>> I'm looking for an equivalent to pascal's old keypressed. >> I'm trying to execute a block till the user presses a key, something like : >> >> while (!keypressed) >> print "." >> end >> >> Is there any such functionality ? > > If we implemented a cross-platform "keypressed", might there be > any chance of it getting into the builtin library? > > A frequent beginner C/C++ FAQ is the one above. It seems like a > high-level language such as ruby should be able to give a good > solution to it, rather than a lengthy answer involving Win32 API > or Termios witchery. select[[$stdin], nil, nil] if key_pressed() does not allow mixing with select(), it lost its efficiency. disclaimer: unlikely to work on Win* +--- Kero ------------------------------ kero / chello.nl ---+ | Don't split your mentality without thinking twice | | Proud like a God -- Guano Apes | +--- M38c ---------- http://httpd.chello.nl/k.vangelder ---+