Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I'm running on battery, I prefer to use the TTYs instead of the full blown GUI as I can squeeze a lot more run time out this way.

However, when I want to type in curly braces (AltGr-Shift-è and AltGr-Shift-+ on my Italian keyboard) the TTY (and only that TTY) acts as if I was holding my Alt key.

I also get this problem for any AltGr-Shift key combination -- the curly braces are just the most commonly used for me.

Why is that? How can I prevent it?

Here's my output for stty -a:

speed 38400 baud; rows 48; columns 160; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-    parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon -iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
share|improve this question


sudo dpkg-reconfigure console-setup

to reconfigure your console-setup. During this process you can specify you keyboard setup including the AltGr setup.

If no confguration options are presented run

sudo dpkg-reconfigure -plow console-setup


Under Origin of the keyboard select the correct layout. For example: the US keyboard doesn't have an AltGr key at all. Whereas the German keyboard does have an AltGr key.

Under AltGr key replacement: select the position of the AltGr key. Most likely you want to choose Right Alt.

Don't forget to reboot or run setupcon on your tty console.

share|improve this answer
I did that and set the AltGr key to "Right Alt". This didn't fix the problem, however. – badp Nov 23 '10 at 12:27
did you reboot or run setupcon from your tty console? console-setup tells you to do so. – joke Nov 23 '10 at 13:06
Yes, I have done so indeed. – badp Nov 24 '10 at 11:00

My italian layout works out of the box.

You could try loadkeys it but if your other keys are working I think that the italian layout is already loaded.

Maybe you have some sort of uncommon keyboard and you need to create your own keymap.

From dumpkeys on my italian laptop keyboard I see:

shift altgr keycode 26 = braceleft
shift altgr keycode 27 = braceright

where 26 is keycode for egrave and 27 is plus. You can get your keycodes with showkey command.

share|improve this answer
The problem is that altgr-shift enables some sort of alt lock on the tty I'm in -- no curly brace is sent to the terminal in the first place. – badp Oct 20 '10 at 5:19
Can you post your stty -a output? – Luca Oct 20 '10 at 14:00
Sorry for the LOOONG delay. Here it is. – badp Nov 23 '10 at 10:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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