Module: Kernel

Defined in:
lib/keyevent.rb

Instance Method Summary collapse

Instance Method Details

#getkeyObject



22
23
24
25
26
27
28
29
30
31
# 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