0

I have tried the following:

(keyboard-translate ?\C-I (kbd "<f8>"))
(keyboard-translate ?\C-I [(f8)])

The representation of F8 key is wrong.

1
  • 1
    The way you use keyboard-translate you hit ?\C-I and get (kbd "<f8>").
    – Tobias
    Commented Aug 9, 2023 at 4:18

1 Answer 1

1

keyboard-translate takes character arguments, and (kbd "<f8>") does not evaluate to a character.

Try this:

(define-key key-translation-map (kbd "C-i") (kbd "<f8>"))

but take note! C-i is the same thing as TAB, so this also makes the TAB key act as F8.

In GUI frames you can use bindings for <tab> which is independent of TAB; but for cross-terminal compatibility anything binding the TAB key will normally use TAB and leave it to the default translation of <tab> => TAB to make GUI and text terminals behave the same way. So if you don't want your TAB key to act as F8 you probably need to introduce a bunch of new bindings for <tab> (and then only use GUI frames).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.