Function: kbd

kbd is a byte-compiled function defined in subr.el.gz.

Signature

(kbd KEYS)

Documentation

Convert KEYS to the internal Emacs key representation.

KEYS should be a string in the format returned by commands such as C-h k (describe-key). This is the same format used for saving keyboard macros (see edmacro-mode).

For an approximate inverse of this, see key-description.

Probably introduced at or before Emacs version 1.9.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
;;;; Keymap support.

(defun kbd (keys)
  "Convert KEYS to the internal Emacs key representation.
KEYS should be a string in the format returned by commands such
as `C-h k' (`describe-key').
This is the same format used for saving keyboard macros (see
`edmacro-mode').

For an approximate inverse of this, see `key-description'."
  ;; Don't use a defalias, since the `pure' property is true only for
  ;; the calling convention of `kbd'.
  (declare (pure t) (side-effect-free t))
  ;; A pure function is expected to preserve the match data.
  (save-match-data (read-kbd-macro keys)))