Distinguish <C-i> from "C-i"

This commit is contained in:
Henrik Lissner 2020-12-11 01:44:41 -05:00
parent a3b8be52a8
commit 96d7e50f3e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 12 additions and 1 deletions

View file

@ -39,6 +39,15 @@ and Emacs states, and for non-evil users.")
(setq w32-lwindow-modifier 'super
w32-rwindow-modifier 'super)))
;; HACK Fixes Emacs' disturbing inability to distinguish C-i from TAB.
(define-key key-translation-map [?\C-i]
(cmd! (if (and (not (cl-position 'tab (this-single-command-raw-keys)))
(not (cl-position 'kp-tab (this-single-command-raw-keys)))
(display-graphic-p))
[C-i] [?\C-i])))
;; However, ensure <C-i> falls back to the old keybind if it has no binding.
(global-set-key [C-i] [?\C-i])
;;
;;; Universal, non-nuclear escape