This question pertains to an installation of Xubuntu 16.04.3 LTS with current kernel 4.4.0-116-generic x86_64. I am running a Lenovo laptop W530 and the keyboard is a German one (QWERTZU).
Initial issue
I installed a new version of a commercial program which differs from all other Ubuntu programs which I used so far (including the previous version of that program) with respect to keyboard entry: It suppresses the dead keys, i.e. neither does pressing them twice produce those accents alone nor does pressing them once followed by one of the characters known with that accent after it produce the accent carrying version of that character.
Unfortunately the caret character ^, akut ´ and gravis ` are used frequently within that program. I contacted the support of that program. They could not reproduce this problem with Ubuntu 18.04 and they asked me for the exact settings of my keyboard and language settings.
Problems risen during trials to narrow down the issue
I searched long and still did not find a way how to unambiguously communicate what language settings are in effect on my computer. I am still looking for some command or what system file to list to unambiguously communicate those system settings. I only could take screenshots from the GUI programs to set the keyboard settings and to set the country settings.
In experimenting with the keyboard and in order to communicate its results in other programs (like LibreOffice, Mousepad and Thunderbird), I tried all keys in the combinations with Shift, Alt and AltGr and I carefully observed if and where there are “dead keys” (which produce an action on the next character if it is one which is used in combination with that special feature).
I found the following results:
The uppermost row below keys produces (e.g. in mousepad or Thunderbird)
shifted: ° ! " § $ % & / ( ) = ? `
unshifted: ^ 1 2 3 4 5 6 7 8 9 0 ß ´
shift+AltGr: ″ ¡ ⅛ £ ¤ ⅜ ⅝ ⅞ ™ ± ° ¿ ˛
with AltGr: ′ ¹ ² ³ ¼ ½ ¬ { [ ] } \ ¸
row of the tab-key:
shifted: Q W E R T Z U I O P Ü *
unshifted: q w e r t z u i o p ü +
shift+AltGr: Ω Ł € ® Ŧ ¥ ↑ ı Ø Þ ° ¯
with AltGr: @ ł € ¶ ŧ ← ↓ → ø þ " ~
row of the caps-lock key
shifted: A S D F G H J K L Ö Ä '
unshifted: a s d f g h j k l ö ä #
shift+AltGr: Æ ẞ Ð ª Ŋ Ħ ˙ & Ł ̣ ˇ ˘ (the one belonging to J the last three Ö, Ä and ' and act like dead keys for certain other keys like ȧạčŏ)
with AltGr: æ ſ ð đ ŋ ħ ̣ ĸ ł ˝ ^ ’ (those belonging to j, ö and ä act like dead keys for certain other keys like ạőĉ)
row of the shift-key
shifted: > Y X C V B N M ; : _
unshifted: < y x c v b n m , . -
shift+AltGr: ¦ › ‹ © ‚ ‘ ’ º × ÷ —
with AltGr: | » « ¢ „ “ ” µ · … – (the tree dots are produced by AltGr+.)
After carrying out a lot of experiments, finally I must have mixed up something since now, I can not longer produce the AltGr and the Shift-AltGr results any longer. I must have changed something inadvertently – but what the hell was it and how can I return to what I had before?
My questions
How do I unambiguously communicate the actual settings of my current keyboard configuration? 1a. What commands to run to communicate their output? 1b. Content of which system files shall I communicate?
How can I restore the working of AltGr key combinations to what I had before (documented above)?
Further question to learn programming in Ubuntu environment
If someone reading this post could give me some explanation how such dead keys are processed from a programmatic point of view: According to an article I read (referring to the new Wayland system) there are different ways for a program to learn about keyboard actions while they have the focus: One which returns the “undigested” keyboard events and one which processes “digested keyboard events”, i.e. an event only happens after the character of a dead key is pressed and the result is the character with the accent (or the accent itself if it is pressed twice or if the second character is a blank). But I do not know which of my applications uses Wayland, as far as I know, most Ubuntu applications either use GTK or they use QT and those all rely on X-Window which is probably the predecessor to Wayland. Some clarifications on the relationships between them would also be very wellcome.
- What are the names of the functions to to be called in order to get primary “undigested” key events and what are the names for the functions to be called with “digested” keyboard actions?
This is only a partial answer on the part 2: "How can I restore the working of AltGr key combinations to what I had before (documented above)?"
sudo dpkg-reconfigure keyboard-configuration
ok
option use the Tab key there. Use these settings on the screens (one question per screen)These messages were shown on the terminal:
You have to reboot in order to make these settings effective.
However, two days later I encountered the same problem and I did not play with settings in between: AltGr-key combinations don't work any longer. Since my recipe how to overcome it requires quite some steps, some analysis how to prevent that would be wellcome. These are some system settings I figured out that they might tell something about the keyboard and the langugage settings but wha's wrong with them?
The really strange thing was that AltGr-key combinations still work when I am logged in with my administrative account. However, after I switch back to the normal user account, AltGr does not work any longer.
After struggeling quite some time with this problem I came about the command
xev -event keyboard
. Strangely this gives different results when logged in with my normal account where AltGr does not work. Then this command returnswheras for the administrative account, where AltGr works and lets me reach the third level of the keyboard it returns:
This time there are two events: One when the Alt key is pressed and another one when it is released, as can be seen. If I would have pressed another key in addition with AltGr there pressing that other key and releasing it would make additional pressing and releasing events, it is similar to what is shown for shifted keys.
From the second answer to How to enable Alt-Gr on Ubuntu 16.04? we learned to change Alternate Chacter Key in System Settings > Keyboard > Shortcuts > Typing to AltGr. I have a German keyboard and the dialogs also speak Geran. Therefore I did this:
Starting with
I changed it to . But that did not work for me, even after a cold start of the computer.
The above solutions did not work for me, but I found that there is one other setting that has the potential to interfere with the correct functioning of AltGr. In 18.04 it can be found under 'Optimierungen->Testatur und Maus->Compose-Taste', which should be set to 'Deaktiviert'. I'm not 100% certain what these are in English but perhaps 'Optimisations->Keyboard and Mouse->Compose Key' set to 'Off'.
Interestingly this setting is not changed by other methods above that involve the compose key.
There are some configuration files in ~/.config/xfce4/ related to keyboard configuration as can be seen from ‘key’ appearing in them. They work per user, as one can see from their location in the file system. AltGr worked for user ‘gast’ so I looked for configuration files containing the word ‘key’.
Since I had a user account ‘a’ where the keyboard mappings for the AltGr key combinations did not work and I had the gast-account where they worked, I compared the contents of these files to their counterparts.
In doing so, I noticed that /home/a/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml was the one which prevented user ‘a’ to use AltGr key combinations. There was a line
in it associating the sceenshooter to the AltGr key. Apparently ISO_Level3_Shift is the name for that key, this name also appeared in the output of xev (as a user with that key functioning). In the counterpiece of .config/xfce4/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml there is no reference to ISO_Level3_Shift. There also were several other deviations between the two versions of this file. Therefore I copied this file from the user which worked to user ‘a’ whoes AltGr key combinations did not work.
However, this having done, the AltGr-Keys did not work immediately for user ‘a’. I had to use the xfce4-keyboard-settings to remove a setting for “Tastenkürzel für die Belegungsänderung” (the left drop down selection box): both of these boxes have to indicate a minus sign which apparently means ‘none’.