Function: ghostel-send-key

ghostel-send-key is a natively compiled function defined in ghostel.el.

Signature

(ghostel-send-key KEY-NAME &optional MODS)

Documentation

Send KEY-NAME with optional MODS to the terminal's key encoder.

KEY-NAME is a string like "a", "return", or "up". MODS is a comma-separated modifier string like "ctrl" or "shift,ctrl", or nil for no modifiers. The encoder respects the terminal's current mode (application cursor keys, Kitty keyboard protocol, etc.).

Signals a user-error when called outside a ghostel buffer.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel.el
(defun ghostel-send-key (key-name &optional mods)
  "Send KEY-NAME with optional MODS to the terminal's key encoder.
KEY-NAME is a string like \"a\", \"return\", or \"up\".  MODS is a
comma-separated modifier string like \"ctrl\" or \"shift,ctrl\", or
nil for no modifiers.  The encoder respects the terminal's current
mode (application cursor keys, Kitty keyboard protocol, etc.).

Signals a `user-error' when called outside a ghostel buffer."
  (ghostel--ensure-ghostel-buffer)
  (ghostel--on-user-input)
  (ghostel--send-encoded key-name (or mods "")))