getch in ruby (windows and linux)

Here it is:
gem install highline

irb(main):001:0> require ‘rubygems’
=> true
irb(main):002:0> require ‘highline’
irb(main):007:0> HighLine::SystemExtensions.get_character
=> 97

it only took one keystroke, trust me :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>