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.

  • 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. – Gilles Apr 26 '17 at 9:40
3

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

(setq x-meta-keysym 'super)
  • Thanks! The line (setq x-super keysym 'meta) did the trick, but is not taking effect when running emacs in the terminal. – explaw Mar 26 '17 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). – Gilles Apr 26 '17 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 Aug 17 '17 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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