Liking cljdoc? Tell your friends :D

charm.input.keys

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.
raw docstring

ctrl-char->keyclj

Maps control characters (0-31) to key types.

Maps control characters (0-31) to key types.
sourceraw docstring

ctrl-char?clj

(ctrl-char? byte-val)

Check if a byte value is a control character.

Check if a byte value is a control character.
sourceraw docstring

escape-prefix?clj

(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.
sourceraw docstring

key-matches?clj

(key-matches? key pattern)

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}
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}
sourceraw docstring

key-typesclj

All recognized key types.

All recognized key types.
sourceraw docstring

make-keyclj

(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
sourceraw docstring

parse-ctrl-charclj

(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.
sourceraw docstring

parse-escape-sequenceclj

(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.
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