Function: kkp-teardown-function-keys

kkp-teardown-function-keys is a natively compiled function defined in kkp.el.

Signature

(kkp-teardown-function-keys TERMINAL)

Documentation

Deactivate alternative keypad mappings in TERMINAL.

Restore the original `local-function-key-map` for the first frame on TERMINAL’s display by removing `kkp-alternatives-map` as a parent. Once done, the function-keys-set flag in the terminal's kkp--state is reset so that setup can be applied again later if needed.

Source Code

;; Defined in /nix/store/0igl9q4k4n87vg4h2gnnrlha21kx9biv-emacs-packages-deps/share/emacs/site-lisp/elpa/kkp-20260706.858/kkp.el
(defun kkp-teardown-function-keys (terminal)
  "Deactivate alternative keypad mappings in TERMINAL.
Restore the original `local-function-key-map` for the first frame on TERMINAL’s
display by removing `kkp-alternatives-map` as a parent. Once done, the
`function-keys-set' flag in the terminal's `kkp--state' is reset so that
setup can be applied again later if needed."
  (let ((state (kkp--terminal-state terminal)))
    (when (and state (kkp--state-function-keys-set state))
      (dolist (frame (frames-on-display-list terminal))
        ;; Map certain keypad keys into ASCII characters that people usually expect.
        (with-selected-frame frame
          (set-keymap-parent local-function-key-map (keymap-parent kkp-alternatives-map))))
      (setf (kkp--state-function-keys-set state) nil))))