I'm interested in getting a
C-i not a
\t are the same thing (ASCII character 9; aka
If you want the TAB key to be different to C-i you can achieve that in a GUI environment (but not in a terminal, where they are, again, the same thing).
In GUI environments, the event
<tab> is sent to Emacs when the TAB key is used.
9) so that in a GUI environment the TAB key will have the same effect in Emacs that it has in a terminal.
(lookup-key function-key-map (kbd "<tab>"))
This translation takes place only if no binding for the
<tab> event itself was found; so if you do bind something to
<tab> it will take precedence over any
TAB bindings. Normally1 there are no bindings for
<tab>, though, and so the translation tends to take place.
If you want to prevent the translation entirely, you'll need to disable that
(define-key function-key-map (kbd "<tab>") nil)
This would completely separate
C-i in a GUI environment.
1 Note that most commands with a tab binding will be using the terminal-friendly value, so expect some things to stop working in a GUI environment if you remove that translation. You would need to either use
C-i to invoke those commands, or else add custom bindings for
<tab> to replicate them.