1

MacBook Pro running 10.15.7. My beloved old external keyboard which emulates an IBM thinkpad (yes, with the pressure stick between g and h!) is starting to go. I have a backup keyboard but alas: ESC is half the size and I keep hitting F1. I wish to remap F1 to ESC. The other mappings (e.g. CapsLock -> Ctrl) are straightforward and working using the Settings->Keyboard->Modifier Keys capability.

Far and away the biggest use case here is ESC as meta in emacs, so if there is an "easier" means to change F1 to meta only in emacs I am good with that too.

Buzz Moschetti
  • 7,057
  • 3
  • 23
  • 33
  • How did you achieve your "straightforward and working" mappings, and what have you tried so far for remapping F1? – phils Mar 16 '21 at 02:59
  • The standard Modifier Keys Caps/Control/Alt swaps; post altered for clarity there. I have examined various `(setq)' and permutations of `(global-set-key (kbd "") 'meta) but it seems to not do the trick. – Buzz Moschetti Mar 16 '21 at 14:04

1 Answers1

1

if there is an "easier" means to change F1 to meta only in emacs I am good with that too.

Try this:

(define-key key-translation-map (kbd "<f1>") (kbd "ESC"))
phils
  • 71,335
  • 11
  • 153
  • 198