3

I have launched emacs (emacs -Q) in the console(Ctrl+Alt+F1). The "left Alt key" is working whereas the "right Alt key" is not working. How to fix the problem. I am running emacs on archlinux

3
  • Can you be more specific? What are you trying to achive? What is your expected behaviour when pressing "right alt key" and what are you getting? Commented Apr 23, 2012 at 8:41
  • i expect the "right alt key" also to act as the Meta key as in ubuntu Commented Apr 23, 2012 at 16:28
  • When i press "Right ALT key + x", x is printed in the current buffer as thought there is no effect on the "Right ALT key". Commented Apr 23, 2012 at 16:38

3 Answers 3

3

This behavior is controlled by the keyboard layout you are using. In the layout that you are using, the left alt is Meta, whereas the right alt is Alt-graphic which allows you to enter accentuated character. Change your keyboard layout to one not using the right alt as Alt-graphic

Sign up to request clarification or add additional context in comments.

3 Comments

In ubuntu "Right ALT-x" will prompt M-x in the mini buffer, How to get the same behaviour
It has to do with the keyboard layout that you are using.
It is very nice explanation of why it is happening, but does not explain how to fix it.
1

The solution is described here:
http://www.joshstaiger.org/archives/2005/04/fixing_the_righ.html

It needs some modifications though (see item 3.2 below). Otherwise one would not be able to type anything in current console after the first press of [Right Alt]. If this happened to you, switch to other console (e.g. [Ctrl+Alt+F2]) and restore old keymap.

Here is the brief description of the modified solution:

  1. Save current keymap to file:
    dumpkeys >> mykmap
    and make a backup of it:
    cp mykmap oldkmap
  2. Capture [Right Alt] keycode using showkey command. Let's assume it is 100.
  3. Edit mykmap:
    1. Find the corresponding line:
      keycode 100 = AltGr
      and change it to:
      keycode 100 = Alt
    2. If the next line (or one of the next lines) is:
      alt keycode 100 = Compose
      remove it.
  4. Load new keymap:
    loadkeys mykmap
  5. Make the changes permanent (e.g. add the last command to ~/.bashrc).

Comments

0

There is a workaround. Hit Esc key to activate the alt key as meta in emacs. So a command like M-v becomes Esc M-v

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.