In short, this should solve the problem for you:
(setq local-function-key-map (delq '(kp-tab . [9]) local-function-key-map))
(global-set-key (kbd "C-i") 'forward-word)
Longer version:
From the emacs lisp documentation on function keys:
In ASCII, C-i and <TAB> are the same character. If the terminal can distinguish between them, Emacs conveys the distinction to Lisp programs by representing the former as the integer 9, and the latter as the symbol tab.
Most of the time, it's not useful to distinguish the two. So normally local-function-key-map (see Translation Keymaps) is set up to map tab into 9. Thus, a key binding for character code 9 (the character C-i) also applies to tab. Likewise for the other symbols in this group. The function read-char likewise converts these events into characters.
So, once you do the following, you can see the difference in the key bindings:
(setq local-function-key-map (delq '(kp-tab . [9]) local-function-key-map))
;; this is C-i
(global-set-key (kbd "C-i") (lambda () (interactive) (message "C-i")))
;; this is <tab> key
(global-set-key (kbd "<tab>") (lambda () (interactive) (message "<tab>")))
Note, each mode sets up the various TAB bindings differently, so you may need to do customization per mode that you care about.
Version Dependency:
The above works for Emacs 23.1. From the NEWS file:
Function key sequences are now mapped using `local-function-key-map', a new variable. This inherits from the global variable function-key-map, which is not used directly any more.
Which means, in versions 22 and earlier, you can get the same effect by using t
I recommend the following:
(define-key input-decode-map (kbd "C-i") (kbd "H-i"))
(global-set-key (kbd "H-i") 'whatever-you-want)
It should work from at least Emacs 23.
This is similar to the keyboard-translate technique in Caio's answer, but operates at a slightly higher level.
The disadvantage of keyboard-translate is that it will take effect even
when Emacs isn't running read-key-sequence, and in particular C-q C-i
will no longer work as a way to insert a literal tab character.
Modifying local-function-key-map doesn't work well, because typically
you want the <tab> key to continue doing whatever the current mode has
defined for TAB.