From: Usano Date: 2002-12-19T15:14:47+09:00 Subject: Re: How to read a single character from DOS prompt in windows (without )? Hmmmm. This worked ok in my little test file, but the character is still in a buffer somewhere. In my program, I hit 'n' to not do something, then 'puts' to the command line with no problem -- then when I do a 'gets' the 'n' prints out. What the heck? - Usano require 'Win32API' print "Question? (Y/N): " char = Win32API.new('crtdll', "_getch", [], 'L').Call putc char putc ?\n if [?y,?Y].include? char puts "You pressed 'Y'" else puts "You pressed something other than 'Y'" end gets # this prints the 'y' or 'n' !!!