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
- 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?Matthias– Matthias2012-04-23 08:41:40 +00:00Commented Apr 23, 2012 at 8:41
- i expect the "right alt key" also to act as the Meta key as in ubuntuTalespin_Kit– Talespin_Kit2012-04-23 16:28:11 +00:00Commented 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".Talespin_Kit– Talespin_Kit2012-04-23 16:38:10 +00:00Commented Apr 23, 2012 at 16:38
3 Answers
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
3 Comments
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:
- Save current keymap to file:
dumpkeys >> mykmap
and make a backup of it:
cp mykmap oldkmap - Capture
[Right Alt]keycode usingshowkeycommand. Let's assume it is100. - Edit
mykmap:- Find the corresponding line:
keycode 100 = AltGr
and change it to:
keycode 100 = Alt - If the next line (or one of the next lines) is:
alt keycode 100 = Compose
remove it.
- Find the corresponding line:
- Load new keymap:
loadkeys mykmap - Make the changes permanent (e.g. add the last command to ~/.bashrc).