From: Simon Blanco Date: 2008-06-19T08:04:38+09:00 Subject: Re: How to capture a keypress > I have not tried it, but you may want to take a look at this. > > http://blog.grayproductions.net/articles/i_just_want_one_character > > > Harry Sorry for the delay firstly. I've been busy lately :D I've read over the documentation of Highline and didn't find what I needed, but after it I checked out the rawline gem and I found a great example at the author's web (http://www.h3rald.com/blog/inline-introduction): #!/usr/local/bin/ruby -w require 'rubygems' require 'highline/system_extensions' include HighLine::SystemExtensions puts "Press a key to view the corresponding ASCII code(s) (or CTRL-X to exit)." loop do print "=> " char = get_character case char when ?\C-x: print "Exiting..."; exit; else puts "#{char.chr} [#{char}] (hex: #{char.to_s(16)})"; end end ...so I can use highline finally (thanks! :D) I just don't understand one thing from the code above: the "?\C-x", in the when statement. Can anybody tell me what does it mean? -- Posted via http://www.ruby-forum.com/.