Key sequence definitions and parsing.
Maps terminal escape sequences to key types and provides utilities for key identification.
For escape sequence lookup, see charm.input.keymap which uses JLine's KeyMap for efficient terminal-aware sequence matching.
Key sequence definitions and parsing. Maps terminal escape sequences to key types and provides utilities for key identification. For escape sequence lookup, see charm.input.keymap which uses JLine's KeyMap for efficient terminal-aware sequence matching.
Maps control characters (0-31) to key types.
Maps control characters (0-31) to key types.
(ctrl-char? byte-val)Check if a byte value is a control character.
Check if a byte value is a control character.
(escape-prefix? s)Check if a string starts with a known escape sequence prefix.
Check if a string starts with a known escape sequence prefix.
(key-matches? key pattern)Check if a key event matches a pattern. Pattern can be:
Check if a key event matches a pattern.
Pattern can be:
- A string like "ctrl+c", "alt+x", "enter"
- A key type keyword like :enter, :up
- A map like {:type :runes :runes "c" :ctrl true}(make-key {:keys [type runes ctrl alt shift]
:or {ctrl false alt false shift false}})Create a key event map.
Options: :type - Key type keyword (required) :runes - Character(s) for :runes type :ctrl - Ctrl modifier pressed :alt - Alt modifier pressed :shift - Shift modifier pressed
Create a key event map. Options: :type - Key type keyword (required) :runes - Character(s) for :runes type :ctrl - Ctrl modifier pressed :alt - Alt modifier pressed :shift - Shift modifier pressed
(parse-ctrl-char byte-val)Parse a control character (byte 0-31 or 127) into a key map.
Parse a control character (byte 0-31 or 127) into a key map.
(parse-escape-sequence seq-str)(parse-escape-sequence keymap seq-str)Parse an escape sequence (without ESC prefix) into a key map. Uses JLine KeyMap for efficient lookup.
Parse an escape sequence (without ESC prefix) into a key map. Uses JLine KeyMap for efficient lookup.
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 |