2

How can I make an alternative keyboard key (e.g. the Windows key) act as the meta key in emacs?

I am looking for a solution internal to emacs, so using xmodmap is out of the question.

1
  • You can remap keys per application (by having the window manager switch mappings on a window focus switch), but I don't know of a convenient way to do that. Xxkb does layout switching but I don't know how to configure it to move modifiers around. Commented Apr 26, 2017 at 9:40

1 Answer 1

3

The following elisp may help you out. Just add it to your config.

(setq x-meta-keysym 'super)
3
  • Thanks! The line (setq x-super keysym 'meta) did the trick, but is not taking effect when running emacs in the terminal.
    – explaw
    Commented Mar 26, 2017 at 23:33
  • 1
    @explaw Doing this in a terminal is completely different and may or may not be possible depending on which terminal emulator you use. You should ask a new question about this (since you mentioned xmodmap as an alternative here, your question was implicitly about X11). Commented Apr 26, 2017 at 9:38
  • This was helpful; I did (setq x-super-keysym 'meta) to make GUI emacs work for as I wanted in Ubuntu
    – haksayng
    Commented Aug 17, 2017 at 7:31

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.