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.
(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
(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.
(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)
(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)
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |