secluded/content/posts/typing-international-charac...

5.6 KiB
Raw Blame History

title description author date draft tags categories cover toc
Typing International Characters Setting up your keyboard so you can type international characters such as ß, ñ, and ü in addition to a myriad of others (™, ©, ¢, €, ∵, ∞, §, ¶, etc.) Amolith 2020-04-08T13:21:39-04:00 false
Keyboard
Typing
Writing
International
Typography
Technology
/assets/pngs/keyboard.png true

My first computer was an Acer C710 Chromebook. There were a lot of problems with it but one thing I always appreciated were its dead keys. Until a few days ago, I had completely forgotten what the feature was called. Once I figured it out, however, I was able to do some digging and find the answer fairly quickly.

Dead keys

Dead keys1 are actually a type of modifier, like Ctrl or Shift. They allow people to type accented characters that don't appear on their keyboard. For example, I have a US keyboard and there is no enye (the diactric2 mark over the ñ) as can be found on Spanish and Latin American layouts.

I'm not exactly sure why but dead keys don't have to be held down when you want to use them but they don't; simply strike the dead key then the character you intend to modify and the resulting accented character will be rendered properly.

Dead keys allow writers to use far more characters that just the accented ones found in various alphabets. Indeed, one can type a very wide variety of symbols:

™ © ® § ¶ ∵ € ¢ ¥ ⅞ x³ ∞ ¬ ÷ ± × ≠ ♪ ♬ ♭ ♮ ♯ → ⇒ ☭ ㉔ ⓐ ß æ ø Œ

The full list of all possible combinations (on Linux) can be found in the documentation from David Monniaux. For a shorter but easier-to-read list, refer to the GtkComposeTable from Ubuntu.

Compose key

If you write code at all, enabling dead keys alone would be an absolute nightmare. To get double quotes, you would have type " then Space every single time. The same goes for ', :, ;, ~, etc. The compose key3 makes this much less of an issue. When struck, it indicates that the next few keys (2 or more) are to function as dead keys. With this enabled, you can write code without abusing your space bar but also type résumé4 correctly.

I have found this absolutely invaluable in my German course. I am able to type something like Linux ist großartig without searching "eszet" and copying it from Wikipedia5.

Usage

How you enable dead keys or the compose key depends entirely on your operating system. I'm sure most Linux distributions that ship with a DE6 like GNOME, KDE, XFCE, etc. will have a GUI option in the settings. I use Arch Linux with i3-gaps and thus don't have a GUI to manage these kinds of things. That's where the Arch Wiki comes in.

Depending on whether you want dead keys or a compose key, there are different commands to run. I'm not sure how to enable the former—you'll need to read the page for that yourself—but mapping an existing key to compose is really easy.

List what your options are

grep "compose:" /usr/share/X11/xkb/rules/base.lst

Copy which first column you want and paste it into this command

setxkbmap -option <option-goes-here>

I 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:

setxkbmap -option compose:ralt

For other interesting things you can do with your keyboard, check that whole section of the Arch Wiki. It's really one of the best resources there is for this kind of thing.

Edit

Since the time of publication, I've started using Wayland and configuring your keyboard with setxkbmap doesn't work. Instead, assuming you're running sway, add something along this vein to your config. If you want to use something other than your right Alt key, make sure you change that.

input type:keyboard xkb_options compose:ralt

  1. They're called dead keys because, with most keyboards and operating systems, there is no visual indication that it's been struck; the key appears to be dead. ↩︎

  2. Dictionary.com: "a mark, point, or sign added or attached to a letter or character to distinguish it from another of similar form, to give it a particular phonetic value, to indicate stress, etc.↩︎

  3. Also known as a multi key ↩︎

  4. Yes, résumé is the correct spelling. Resume is accepted but it's more correct with the diacritical2 marks. ↩︎

  5. I also had to do the same when I wanted to add an umlaut to anything, as in über ↩︎

  6. DE is short for Desktop Environment. If you're not familiar with the term, a DE is basically a suite of applications and programs that make up the interface a computer user interacts with. The dock on macOS, the start menu on Windows, your file manager, these are all examples of tightly integrated applications that provide the core functionality of whatever operating system you use. ↩︎