Score:1

Tilde and singe quote not working on Norwegian mac keyboard

cn flag

During installation of Ubuntu 20.04 LTS, I chose "Norwegian (Macintosh, no dead keys)" as keyboard layout, because testing it during install indicated that it worked better than my other option "Norwegian (Macintosh)".

I can not get tilde and single quotes, and a whole lot of other special characters, to work.

The problem has existed since my first login. It exists in both the Terminal and GUI applications like LibreOffice and gedit. There is one difference regarding the tilde key: In terminal I get a diamond with a question mark when I try to type it, (unicode replacement character), whereas in GUI applications I get nothing.

Going into Settings -> Region and Language -> Input sources, I can display the keyboard. It shows everything mostly correctly, except it shows an ANSI keyboard layout instead of an ISO keyboard which I have. The tilde is at the expected place, I just can not produce it by typing (it is supposed to be Alt + a regular key), and the single quote is nowhere to be found.

When pressing keys while the keyboard is displayed, it correctly identifies all modifier and regular keys, except two regular keys are switched which is surely related to the ANSI/ISO keyboard issue. That is something I can live with. Each key has four symbols on it, but in the terminal and GUI apps, I can only produce the two symbols on the left, which is produced by either the key alone or Shift+Key. Other modifier keys seems to have either no effect, or trigger some shortcut.

Reading the forums I have tried:

sudo dpkg-reconfigure keyboard-configuration

Here I can either select "Apple" as the keyboard model and end up with the same problem(s), or select "Apple Aluminium ISO", which is my exact model. Most other settings I can change seem either obvious or plain wrong. If choosing Apple Aluminium ISO, after reboot, a Norwegian keyboard layout is selected in the settings, and displaying the keyboard shows the correct form and placement of all keys, but when typing in the Terminal or GUI app it acts like a US keyboard, with all keys in the wrong place and no Norwegian letters "æøå". Choosing "Norwegian (Macintosh)" instead of "Norwegian (Macintosh, no dead keys)" seems to have no effect. Changing keyboard model back to "Apple" resolves this issue, but my original problem persists.

$ cat /etc/default/keyboard
XKBLAYOUT=no,us
XKBVARIANT=mac_nodeadkeys,
BACKSPACE=guess
$ setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      apple
layout:     no,us,us
variant:    mac_nodeadkeys,,
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+no(mac_nodeadkeys)+us:2+us:3+inet(evdev)
geometry:   pc(pc104)
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+no(mac_nodeadkeys)+us:2+us:3+inet(evdev)"   };
    xkb_geometry  { include "pc(pc104)" };
};

I have had different outputs from these commands before, but the problem stays the same.

Score:1
uz flag

Both Norwegian (Macintosh) and Norwegian (Macintosh, no dead keys) seem to be keyboard layouts which have quite a few 3:rd and 4:th level symbols without automatically defining a key to make use of those.

To set it up, install gnome-tweaks and then:

Tweaks -> Keyboard & Mouse -> Additional Layout Options -> Key to choose the 3rd level and finally check the Right Alt option.

But still: The single quote — apostrophe — seems to have been sacrificed for æ. On the basic Norwegian layout a single quote can be typed by pressing the key to the right of the æ key.

Edit:

One way to fix the single quote:

  • Open the /usr/share/X11/xkb/symbols/no file for editing.

  • Find this line:

    key <BKSL>   { [apostrophe,   asterisk, dead_doubleacute, multiply ] };
    

    at the top of the file in the "basic" section and copy it.

  • Scroll to the xkb_symbols "mac_nodeadkeys" section and paste the copied line into that section.

  • Replace <BKSL> in the copied line with <TLDE>.

  • Do possible other edits to your liking.

  • Save.

Balthazar avatar
cn flag
Thank you. Now tilde works. Only apostrophe remains. I did not understand this part "On the basic Norwegian layout a single quote can be typed by pressing the key to the right of the æ key.". In macOS I would get an apostrophe with the top left key, just below <ESC>. The key right to the "æ" key gives me "@", or "*" with Shift, just like in macOS.
Balthazar avatar
cn flag
If the apostrophe issue can not be solved by point and click, would you happen to know if I could edit some configuration file to get it fixed, without messing up Ubuntu, or doing something I might regret?
Gunnar Hjalmarsson avatar
uz flag
@Balthazar: See my edited answer.
Balthazar avatar
cn flag
Thank you! I cannot upvote your comments yet because of not enough rep, but thanks anyway.
Gunnar Hjalmarsson avatar
uz flag
@Balthazar: Haha, no problem. Glad that you found it helpful.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.