Sha256: 404b7cf5256271cb63c5920dd97ab3fb098665f4926d29f10ce0f566520895c3

Contents?: true

Size: 205 Bytes

Versions: 10

Compression:

Stored size: 205 Bytes

Contents

# encoding: utf-8

require '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

10 entries across 10 versions & 2 rubygems

Version Path
tty-prompt-0.13.2 examples/key_events.rb
tty-prompt-0.13.1 examples/key_events.rb
tty-prompt-0.13.0 examples/key_events.rb
austb-tty-prompt-0.13.0 examples/key_events.rb
tty-prompt-0.12.0 examples/key_events.rb
tty-prompt-0.11.0 examples/keypress.rb
tty-prompt-0.10.1 examples/keypress.rb
tty-prompt-0.10.0 examples/keypress.rb
tty-prompt-0.9.0 examples/keypress.rb
tty-prompt-0.8.0 examples/keypress.rb