Skip to main content

Getting the Right Alt key (Alt GR) to work in Ubuntu Linux

I've been bothered for a while now that my right alt key labelled 'Alt GR' doesn't work in Ubuntu. It was clear that things weren't right when I ran 'xev' and pressed the two Alt keys - here is the output:

KeyPress event, serial 29, synthetic NO, window 0x3200001,
state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,

KeyPress event, serial 29, synthetic NO, window 0x3200001,
state 0x10, keycode 113 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,

ISO_Level3_Shift? Not really the Alt_R I was looking for!
After reading this Ubuntu bug report I change my keyboard preferences to be "Alt and Meta are on the Alt keys" (found under System -> Preferences -> Keyboard)



Now when I run xev this is what I get:

KeyPress event, serial 30, synthetic NO, window 0x3200001,
state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,

KeyPress event, serial 30, synthetic NO, window 0x3200001,
state 0x10, keycode 113 (keysym 0xffea, Alt_R), same_screen YES,

At last, a working Alt-R key!

Technorati Tags: , , , , ,

Comments

Unknown said…
Thank you, it was really annoying.
Andrew Beacock said…
No problem, it has been bugging me for ages too!
Anonymous said…
Thank you, this has been irritating me since I installed Feisty earlier this summer
Anonymous said…
I did that, but now I have a new problem.
Now I cant use the Alt-key together with numbers to make characters such as ¶¡@£$€¥{[]}\±.
Which kinda sucks, because I use [ ] { } $ a lot for programming, and @ for e-mail addresses.
Andrew Beacock said…
I didn't think you could get the symbols by using Alt I thought that was the job of the Shift key?
Anonymous said…
thank you, this was just what i was searching for
Anonymous said…
great, same problem in Hardy and (thankfully) same solution!

worked for dell xps m1330 laptop

thank you very much for the post!
Anonymous said…
Thanks very much Andrew! , good job :-)
You got 1+ from me :-)
Anonymous said…
(Ubuntu 8.04) I have the same problem only on IntelliJIdea.... ALT-GR is not recognised. In other application it works.

Then i followed your indications, I got the same result as you via xev, and NOW i can't use the ALT-GR neither in other apps....
Andrew Beacock said…
Idea is a java-based program so that could be dealing with keypresses in a different way than normal Ubuntu apps.
Mark Wickens said…
Nice solution to my APL problem mate which uses right ALT as a meta key for a load of other crazy symbols! Cheers.
Max said…
Same problem - different solution: Your solution somehow didn't work with my laptop. So, instead of changing my keyboard preferences to "Alt and Meta are on the Alt keys", I checked "Right Alt, Shift + Right Alt key is Multi_Key" (System -> Preferences -> Keyboard -> Layouts -> Layout Options -> Key to choose 3rd level) and now it perfectly works.

Acer Aspire Timeline 3810T / Ubuntu 9.10
Andrew Beacock said…
Max, cheers for the update, that will make a useful addition if other people have similar issues to you.
Anonymous said…
Thanks Max for your additional comment! Now since a month of struggling with Hardy I can finally write "@" in the Email-Programm ;-)
Unknown said…
Thanks a lot. It solved my problem too.
Unknown said…
Thanks everyone!

What worked for me?

1. Choose 104-Key-Layout, instead of 105 (int)

2. Key to choose 3rd level --> Right Alt Key
aBdul Shajin said…
worked for me..thanks
Hao Lee said…
I checked "Right Alt key nerver chooses 3rd level" in "System -> Preferences -> Keyboard -> Layouts -> Layout Options -> Key to choose 3rd level" abd it works perfectly too!
Thanks for your inspiration!
Hao Lee said…
I checked "Right Alt key nerver chooses 3rd level" in "System -> Preferences -> Keyboard -> Layouts -> Layout Options -> Key to choose 3rd level" abd it works perfectly too!
Thanks for your inspiration!