#!/usr/bin/ruby require "io/console" while true k = STDIN.getch print "#{k.ord} #{k}\n" break if k == "q" end