I just bought a HP DV6-7099EL laptop (Italian keyboard). I'm going to install Debian in a week or two, I just want to test the computer without touching the partitions (just in case I need support/assistance for hardware problems in the first period).

But Debian it's my main system and I need it for work, so I installed it in VirtualBox.

And the problem is this: before launching X11, my AltGr works in the right way (i.e. it allows me to enter @ # [ ] { }), but in X (I tried XFCE, FluxBox, KDE) it stops working, it simply does nothing:

  • AltGr + ò = ò (instead of @)

  • AltGr + à = à (instead of #)

Using xev I found that the code of AltGr is 108, so I tried to modify the keymapping creating ~/.Xmodmap but AltGr behaviour was even weirder:

  • AltGr + ò = nothing

  • AltGr + à = # and carriage return

  • AltGr + è = nothing (instead of [)

  • AltGr + + = sometimes gives ] (which is right), sometimes nothing.

BTW, under Windows the key behaves perfectly as expected.

Edit: Following the advice of trying and experimenting with a Debian live, I managed to have my AltGr working (even in virtualbox) with these commands:

clear mod1
clear mod3
clear mod5
keycode 108 = Alt_R
keysym Alt_R = ISO_Level3_Shift
add mod3 = ISO_Level3Shift

Perhaps the three clear are too many, but at the moment it seems working, and the output of $ xmodmap -pm shows that ISO_Level3_Shift has only the mod3 modifier.

On the net almost everyone says that AltGr is recognized by Xorg as Mode_switch, but here I found out that the right name is ISO_Level3_Shift (or so it seems, empirically). Now I'm too much tired, I go to bed. Thank you again jasonwryan and terdon :-)

  • 3
    Try running a live session from a debian CD to check if its not just some weird conflict with windows. – terdon Oct 11 '12 at 21:52

You can see how X11 guessed your keyboard with:

$ setxkbmap -query
rules:      evdev
model:      pc105
layout:     br
variant:    abnt2

You need find the correct layout and variant for your keyboard. Try some alternatives with:

$ setxkbmap it
$ setxkbmap it qwerty  #i don't know any italian variant

Now you can persist your choose editing /etc/X11/xorg.conf, usually you can omit the xkbVariant option:

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "XkbLayout" "br"
    Option         "XkbVariant" "abnt2"

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.