2

PROBLEM:

Alt-Gr is not functional under X11. It seems that keyboard level 3 (for 'at', 'euro', 'curly brackets', etc.) is not set up upon pressing Alt-Gr. In the text console (reached by Right-Shift Right-Alt 1), this problem does not occur.

Applying settings like:

xmodmap -e "keysym q = q Q at" 

does not cure the problem.

This problem is critical! The system is virtually unusable in X-Windows.

What can be done?

SETUP:

uname -v: Ub#45~20.04.1-Ubuntu SMP Fri Jan 15 11:35:04 UTC 2021

The file /etc/default/keyboard contains:

XKBMODEL="pc105" XKBLAYOUT="de" XKBVARIANT="" XKBOPTIONS="" 

Using xkeycaps/xev shows that:

  • Alt-Gr sends key code '108'

The xmodmap delivers

xmodmap: up to 4 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3 mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb) 

Ouput of xev upon Alt-Gr.

KeyPress event, serial 37, synthetic NO, window 0x3200001, root 0x251, subw 0x0, time 6145247, (1781,-38), root:(1804,42), state 0x10, keycode 108 (keysym 0xff20, Multi_key), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: True KeyRelease event, serial 37, synthetic NO, window 0x3200001, root 0x251, subw 0x0, time 6145491, (1781,-38), root:(1804,42), state 0x10, keycode 108 (keysym 0xff20, Multi_key), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False 
9
  • What desktop environment are you using? This is usually fixed by tweaking the settings of the keyboard in the GUI. What keyboard layout have you set there? Did you use a German variant with dead keys? Commented Jan 26, 2021 at 9:26
  • No, not what it says in /etc/default/keyboard, presumably that's fine since you say it works outside the graphical environment. Since this is a GUI issue, the solution will most likely be in the GUI. So, what have you set in the settings of your desktop environment? And what desktop environment are you using? In any case, you probably just need to enable a version with dead key support. Or change the "key to choose third level" option in your GUI settings. Commented Jan 26, 2021 at 9:49
  • If it's Debian Linux (and derivatives like Ubuntu, (and if the DE / GUI doesn't alter the settings) /etc/default/keyboard applies to X also. Can you add another layout, XKBLAYOUT="de,us" XKBVARIANT=",altgr-intl" ? With this setup you could try AltGr on us layout, to test it. Commented Jan 26, 2021 at 10:04
  • at:Krackout: Unfortunately, it does not work. Commented Jan 26, 2021 at 10:30
  • at:terdon: running keyboard-configuration: PC105, German, German (dead acute), AltGr-default for keyboard layout, no compose key. No change. Commented Jan 26, 2021 at 10:34

1 Answer 1

1

The problem was that switching keyboard profiles, somehow got the xmodmap settings confused. Further, the Multi_Key does not seem to replace the keyboard level 3 properly. So, I created a file $HOME/.Xmodmap by applying

> xmodmap -pke > .Xmodmap 

The I changed the line in .Xmodmap which handles the key code 108, i.e. the one which xev identified as the Alt-Gr key:

keycode 108 = ISO_Level3_Shift ISO_Level3_Shift ISO_Level3_Shift ISO_Level3_Shift 

Then reloaded it via

> xmodmap .Xmodmap 

I waited for a few minutes. And voilá! I got my @ signs, my curly brackets, and my € sign back on my keyboard.

1
  • Mine says keycode 108 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift. Would that be a problem? Commented May 22, 2023 at 22:31

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.