Sha256: 3b8cf7fbfbc0bdb91d8f7f678d83dd654afe07261fb35bb787da77b4a80e7a19

Contents?: true

Size: 221 Bytes

Versions: 7

Compression:

Stored size: 221 Bytes

Contents

# encoding: utf-8

require_relative "../lib/tty-prompt"

prompt = TTY::Prompt::new(interrupt: :exit)

prompt.on(:keypress) do |event|
  puts "name: #{event.key.name}, value: #{event.value.dump}"
end

prompt.read_keypress

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tty-prompt-0.17.2 examples/key_events.rb
tty-prompt-0.17.1 examples/key_events.rb
tty-prompt-0.17.0 examples/key_events.rb
tty-prompt-0.16.1 examples/key_events.rb
tty-prompt-0.16.0 examples/key_events.rb
tty-prompt-0.15.0 examples/key_events.rb
tty-prompt-0.14.0 examples/key_events.rb