Sha256: fd15d1f1fa0f820dc5b59582e9edc7bb3f36fc447b25fca8e92a2ecea1aefdaf

Contents?: true

Size: 1.35 KB

Versions: 30

Compression:

Stored size: 1.35 KB

Contents

### Vedeu.read

This allows the direct reading from the terminal, unencumbered by the
framework.

    Vedeu.read("some input here") # => programmatic cooked mode
                                  #    (default)

    Vedeu.read("\e[24;2~", mode: :raw) # => programmatic raw mode
                                       #    (provides :shift_f12 in
                                       #    this example)

    Vedeu.read(nil, mode: :raw) # => for a single keypress

    Vedeu.read(nil, mode: :cooked) # => (default mode) for a 'line at
                                   #    a time' (pressing 'return'
                                   #    ends the line)

The way that these are used will depend on the mode your terminal is currently set to. Vedeu by default sets this to `:raw` (single character, hidden cursor). `Vedeu.read` by default expects the terminal to be in `:cooked` mode unless you provide the `mode: :raw` option.

- In `:cooked` mode (default), it will trigger a `:_command_` event
  with the input provided, meaning you should bind to :command to
  receive the input.
- In `:raw` mode, it will trigger a `:_keypress_` event with the input
  provided, meaning you should bind to `:key` to receive the input.

You can also access the input given using the API methods:

    Vedeu.all_commands
    Vedeu.all_keypresses
    Vedeu.last_command
    Vedeu.last_keypress

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
vedeu-0.8.32 docs/dsl/by_method/read.md
vedeu-0.8.31 docs/dsl/by_method/read.md
vedeu-0.8.30 docs/dsl/by_method/read.md
vedeu-0.8.29 docs/dsl/by_method/read.md
vedeu-0.8.28 docs/dsl/by_method/read.md
vedeu-0.8.27 docs/dsl/by_method/read.md
vedeu-0.8.26 docs/dsl/by_method/read.md
vedeu-0.8.25 docs/dsl/by_method/read.md
vedeu-0.8.24 docs/dsl/by_method/read.md
vedeu-0.8.23 docs/dsl/by_method/read.md
vedeu-0.8.22 docs/dsl/by_method/read.md
vedeu-0.8.21 docs/dsl/by_method/read.md
vedeu-0.8.20 docs/dsl/by_method/read.md
vedeu-0.8.19 docs/dsl/by_method/read.md
vedeu-0.8.18 docs/dsl/by_method/read.md
vedeu-0.8.17 docs/dsl/by_method/read.md
vedeu-0.8.16 docs/dsl/by_method/read.md
vedeu-0.8.15 docs/dsl/by_method/read.md
vedeu-0.8.14 docs/dsl/by_method/read.md
vedeu-0.8.13 docs/dsl/by_method/read.md