1---
2title: "Typing International Characters"
3description: "Setting up your keyboard so you can type international characters such as ß, ñ, and ü in addition to a myriad of others (™, ©, ¢, €, ∵, ∞, §, ¶, etc.)"
4author: Amolith
5date: 2020-04-08T13:21:39-04:00
6draft: false
7tags:
8 - Keyboard
9 - Typing
10 - Writing
11 - International
12 - Typography
13categories:
14 - Technology
15cover: /assets/pngs/keyboard.png
16toc: true
17---
18
19My first computer was an [Acer C710
20Chromebook.](https://www.cnet.com/products/acer-c710-2055-chromebook/specs/)
21There were a *lot* of problems with it but one thing I always
22appreciated were its dead keys. Until a few days ago, I had *completely*
23forgotten what the feature was called. Once I figured it out, however, I
24was able to do some digging and find the answer fairly quickly.
25
26## Dead keys
27Dead keys[^1] are actually a type of modifier, like `Ctrl` or `Shift`.
28They allow people to type accented characters that don't appear on their
29keyboard. For example, I have a US keyboard and there is no enye (the
30diactric[^2] mark over the ñ) as can be found on Spanish and Latin
31American layouts.
32
33I'm not exactly sure why but dead keys don't have to be held down when
34you want to use them but they don't; simply strike the dead key then the
35character you intend to modify and the resulting accented character will
36be rendered properly.
37
38Dead keys allow writers to use far more characters that just the
39accented ones found in various alphabets. Indeed, one can type a *very*
40wide variety of symbols:
41
42``` text
43™ © ® § ¶ ∵ € ¢ ¥ ⅞ x³ ∞ ¬ ÷ ± × ≠ ♪ ♬ ♭ ♮ ♯ → ⇒ ☭ ㉔ ⓐ ß æ ø Œ
44```
45
46The full list of all possible combinations (on Linux) can be found in
47[the documentation from David
48Monniaux.](https://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre)
49For a shorter but easier-to-read list, refer to the [GtkComposeTable
50from Ubuntu.](https://help.ubuntu.com/community/GtkComposeTable)
51
52## Compose key
53If you write code *at all*, enabling dead keys alone would be an
54absolute *nightmare*. To get double quotes, you would have type `"` then
55`Space` every single time. The same goes for `'`, `:`, `;`, `~`, etc.
56The compose key[^3] makes this *much* less of an issue. When struck, it
57indicates that the next few keys (2 or more) are to function as dead
58keys. With this enabled, you can write code without abusing your space
59bar but also type résumé[^4] correctly.
60
61I have found this absolutely invaluable in my German course. I am able
62to type something like *Linux ist großartig* without searching "eszet"
63and copying it from Wikipedia[^5].
64
65## Usage
66How you enable dead keys or the compose key depends *entirely* on your
67operating system. I'm sure most Linux distributions that ship with a
68DE[^6] like [GNOME,](https://www.gnome.org/) [KDE,](https://kde.org/)
69[XFCE,](https://xfce.org/) etc. will have a GUI option in the settings.
70I use [Arch Linux](https://archlinux.org/) with
71[i3-gaps](https://github.com/Airblader/i3) and thus don't have a GUI to
72manage these kinds of things. That's where the [Arch
73Wiki](https://wiki.archlinux.org/index.php/) comes in.
74
75Depending on whether you want dead keys or a compose key, there are
76different commands to run. I'm not sure how to enable the former—you'll
77need to read [the page for
78that](https://wiki.archlinux.org/index.php/Xorg/Keyboard_configuration)
79yourself—but mapping an existing key to compose is really easy.
80
81List what your options are
82
83``` text
84grep "compose:" /usr/share/X11/xkb/rules/base.lst
85```
86
87Copy which first column you want and paste it into this command
88``` text
89setxkbmap -option <option-goes-here>
90```
91
92I mapped mine to the right `Alt` key as I never use it and it's near the space bar. The command for that would simply be:
93``` text
94setxkbmap -option compose:ralt
95```
96
97For other interesting things you can do with your keyboard, check [that
98whole
99section](https://wiki.archlinux.org/index.php/Xorg/Keyboard_configuration#Frequently_used_XKB_options)
100of the Arch Wiki. It's really one of the best resources there is for
101this kind of thing.
102
103## Edit
104Since the time of publication, I've started using
105[Wayland](https://wayland.freedesktop.org/) and configuring your
106keyboard with `setxkbmap` doesn't work. Instead, assuming you're running
107[sway,](https://github.com/swaywm/sway/) add something along this vein
108to your config. If you want to use something other than your right `Alt`
109key, make sure you change that.
110
111``` text
112input type:keyboard xkb_options compose:ralt
113```
114
115[^1]: They're called dead keys because, with most keyboards and
116 operating systems, there is no visual indication that it's been
117 struck; the key appears to be dead.
118[^2]: [Dictionary.com](https://www.dictionary.com/browse/diacritic?s=t):
119 "*a mark, point, or sign added or attached to a letter or character
120 to distinguish it from another of similar form, to give it a
121 particular phonetic value, to indicate stress, etc.*”
122[^3]: Also known as a *multi key*
123[^4]: Yes, résumé is the correct spelling. Resume is *accepted* but it's
124 *more* correct with the diacritical[^2] marks.
125[^5]: I also had to do the same when I wanted to add an
126 [umlaut](https://wikipedia.org/wiki/Diaeresis_(diacritic)) to
127 anything, as in *über*
128[^6]: *DE* is short for *Desktop Environment*. If you're not familiar
129 with the term, a DE is basically a suite of applications and
130 programs that make up the interface a computer user interacts with.
131 The dock on macOS, the start menu on Windows, your file manager,
132 these are all examples of *tightly* integrated applications that
133 provide the core functionality of whatever operating system you use.