1

Original title: Losing the # key after swapping between keymappings

When I swap between to key-mappings, I seem to lose the functionality of several keys. This seems to affect the hash symbol (located at shift-3) and also the back-tick, a.k.a grave, (located left of the z).

I am using Ubuntu 16.04 LTS, with an Apple slim aluminium keyboard. It looks like this (please ignore the fact that it also has Russian keys in the lower right corners of each key!):

enter image description here

I am having problems finding the correct key-mapping within the settings. Here are the ones I have tried out so far (listed in screen-shot):

enter image description here

The main things I am looking at to notice that they are not the correct mappings are the positions of the back-ticks and the hash symbol. The arrow shows where the back-tick should be:

enter image description here

The first question is then, which key-mapping should I be using, and are there ways to install other mappings? (I would like to avoid creating a custom one!)

My second issue, is that the hash symbol, when located on the 3, seems to stop working as soon as I switch between key-mappings. For example, I used two mappings, English and German (to get access to umlauts etc.) - I switch to German to get access to an umlaut or sharp-S [üöä-ß], and when I swap back to the English key-mapping, the hash symbol on the three no longer works. All other symbols across the numbers work as they should. This seems to fix itself after a restart, so I guess it is a settings issue somewhere between the key-mappings. Any ideas as to what might be causing this??

Edit

screen-shot below of the key-mapping and settings when everything is working as expected, even though the image of the keyboard is incorrect. If I hit shift-3 I get a #, and the back-ticks are being processed from the key highlighted above (one left from the z on my keyboard).

enter image description here

Final update:

After a lot of trial and error, it seems that the solution would be to leave xmodmap (as it is not deprecated) and to start using xkb.
Here is a great tutorial, which also links to other forums, which list further changes that are required if you take this path.

I tried to manually enter keycodes via xmodmap, but this didn't work. I got strange output, which was also discussed here. It was related to different keyInput and keyOutput events.

Newer Ubuntu versions (after around version 13) no longer rely upon xmodmap. There are layers of abstractions from the kernel to your keyboard (see here).

I did not get the ideal working solution before deciding to leave this problem unsolved.

n1k31t4
  • 283

1 Answers1

1

Open the /etc/default/keyboard file for editing and change the line

XKBOPTIONS=""

to

XKBOPTIONS="apple:badmap"

After next reboot those keys should be switched, which ought to be a step in the right direction, at least.

To test this for the current session (not preserved when rebooting) you can run:

setxkbmap -option apple:badmap