Function: kkp--translate-terminal-input
kkp--translate-terminal-input is a natively compiled function defined
in kkp.el.
Signature
(kkp--translate-terminal-input TERMINAL-INPUT)
Documentation
Translate TERMINAL-INPUT according to KKP into an Emacs keybinding.
TERMINAL-INPUT is a list of characters representing the terminal input
sequence. This function dispatches the input sequence to the appropriate
handler based on its terminator:
- Bracketed paste mode sequences are
handled by `kkp--handle-bracketed-paste`.
- Sequences ending with ?u or ?~
are handled by `kkp--handle-u-or-tilde-terminators`.
- Sequences ending with a letter terminator are handled by
`kkp--handle-letter-terminators`.
The function returns the Emacs
keybinding associated with the terminal input sequence.
Source Code
;; Defined in /nix/store/0igl9q4k4n87vg4h2gnnrlha21kx9biv-emacs-packages-deps/share/emacs/site-lisp/elpa/kkp-20260706.858/kkp.el
(defun kkp--translate-terminal-input (terminal-input)
"Translate TERMINAL-INPUT according to KKP into an Emacs keybinding.
TERMINAL-INPUT is a list of characters representing the terminal input
sequence. This function dispatches the input sequence to the appropriate
handler based on its terminator:
- Bracketed paste mode sequences are
handled by `kkp--handle-bracketed-paste`.
- Sequences ending with ?u or ?~
are handled by `kkp--handle-u-or-tilde-terminators`.
- Sequences ending with a letter terminator are handled by
`kkp--handle-letter-terminators`.
The function returns the Emacs
keybinding associated with the terminal input sequence."
;; input has this form: keycode[:[shifted-key][:base-layout-key]];[modifiers[:event-type]][;text-as-codepoints]{u~}
(let ((terminator (car (last terminal-input))))
(or (kkp--handle-bracketed-paste terminal-input)
(and (member terminator '(?u ?~)) (kkp--handle-u-or-tilde-terminators terminator terminal-input))
(and (member terminator kkp--letter-terminators) (kkp--handle-letter-terminators terminator terminal-input)))))