From: gu Date: 2007-09-01T16:20:07+09:00 Subject: keyboard input: one character hi to all! i've seen this question posted many times without a single definitive answer. what i'm trying to get is a single character from the keyboard in a multiplatform solution: i hit the key "h" and rubu knows "h" has been pressed. i need it to detect the imput for a game i'm working on: insertin the key-detection into a loop would actually make the player interact with the game. i've come across the library highline ( http://highline.rubyforge.org/ ). the simplest program require "highline/system_extensions" include HighLine::SystemExtensions #print "Enter one character: " while true char = get_character if char != nil puts char.chr end end only works to a certain extend. it puts out the received character only after the end of the program, not during its execution, for some strange reason. moreover it blocks the execution of the program while integrated into a gosu ( http://code.google.com/p/gosu/ ) framework. on the other hand, any attempt on using curses results, don't know why, in the error: LINES value must be >= 2 and <= -2616: got 1 initscr(): LINES=1 COLS=1: too small. anyone can help?