Liking cljdoc? Tell your friends :D

charm.input.handler

Terminal input handling.

Reads raw terminal input and converts it to structured key and mouse events.

Terminal input handling.

Reads raw terminal input and converts it to structured
key and mouse events.
raw docstring

create-handlerclj

(create-handler terminal)

Create an input handler for a terminal.

Returns a map with: :terminal - The terminal :keymap - Terminal-aware KeyMap for escape sequences :read-event - Function to read next event :stop - Function to stop the handler

Create an input handler for a terminal.

Returns a map with:
  :terminal   - The terminal
  :keymap     - Terminal-aware KeyMap for escape sequences
  :read-event - Function to read next event
  :stop       - Function to stop the handler
sourceraw docstring

parse-inputclj

(parse-input byte-val)
(parse-input byte-val escape-seq)
(parse-input byte-val escape-seq keymap)

Parse a raw input byte into an event. For escape sequences, pass the sequence after ESC. Optionally accepts a KeyMap for terminal-aware sequence lookup.

Parse a raw input byte into an event.
For escape sequences, pass the sequence after ESC.
Optionally accepts a KeyMap for terminal-aware sequence lookup.
sourceraw docstring

read-eventclj

(read-event terminal & {:keys [timeout-ms keymap] :or {timeout-ms 50}})

Read a single input event from the terminal. Returns an event map with :type and other keys, or nil on timeout.

Options: :timeout-ms - Timeout for reading (default 50) :keymap - KeyMap for escape sequence lookup (optional, creates terminal-aware one if nil)

Read a single input event from the terminal.
Returns an event map with :type and other keys, or nil on timeout.

Options:
  :timeout-ms - Timeout for reading (default 50)
  :keymap     - KeyMap for escape sequence lookup (optional, creates terminal-aware one if nil)
sourceraw docstring

read-eventsclj

(read-events terminal & opts)

Create a lazy sequence of input events from the terminal. Blocks waiting for each event.

Options: :timeout-ms - Timeout for reading (default 50) :keymap - KeyMap for escape sequence lookup (optional)

Create a lazy sequence of input events from the terminal.
Blocks waiting for each event.

Options:
  :timeout-ms - Timeout for reading (default 50)
  :keymap     - KeyMap for escape sequence lookup (optional)
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close