From: AW Date: 2002-12-17T05:23:47+09:00 Subject: Re: How to read a single character from DOS prompt in windows (without )? This (or something like it) was posted a while ago by some helpfull person (I forget their name). Its a win32 version. require 'Win32API' kbhit = Win32API.new("crtdll", "_kbhit", [], 'L') getch = Win32API.new("crtdll", "_getch", [], 'L') loop{ puts " #{getch.Call.chr} pressed" if kbhit.Call != 0 sleep 0.1 } >Can anyone tell me how to get a single character from the command line >prompt without the user pressing ? This would be in response >to a Yes/No question or a number from a simple printed menu. > >I did notice something in my "The Ruby Way" book which talked about >the feature being in TK. Is there nothing in standard Ruby? > >Thanks, > - Usano