From: Park Heesob Date: 2002-08-28T11:23:08+09:00 Subject: Re: question: passive console input Hi, "AW" wrote in message news:58Oa9.140064$vg.23731191@twister.nyroc.rr.com... > Hi, how is it that i'm able to read console input without halting the > program. I want my program to run and update itself, but when a user > presses a single key the program will read it precess it. Is there an > ansi function to do this? any non ansi function? i'm writing this > under windows. What about this? --------------------------------------------- require 'Win32API' kbhit = Win32API.new("crtdll", "_kbhit", [], 'L') getch = Win32API.new("crtdll", "_getch", [], 'L') for i in 0 .. 100000 puts "#{i} #{getch.Call.chr} pressed" if kbhit.Call != 0 end ---------------------------------------------- Park Heesob