module Kernel

Public Instance Methods

getkey() click to toggle source
# File lib/keyevent.rb, line 22
def getkey
  input = STDIN.getch

  if input == Keyevent::ESC
    input << STDIN.read_nonblock(3) rescue nil
    input << STDIN.read_nonblock(2) rescue nil
  end

  input
end