Back to top

Fast and easy typing—special characters

Unless you're one of those hip “talks to their phone” dingbats, or you are but have a bad cold, you spend a significant amount of time typing. Speeding it up means a lot for your efficiency. Learning to touch type is an obvious way of not only making you faster but also reducing the strain of switching your attention between thinking about what you're trying to say and the physical act of typing. Not to mention the annoying head bobbing and eye focus coordination, it's all taking a toll on your CPU

I get neck pain just from looking at this.

But even with touch-typing in hand (fingers?) there was still a problem I found very frustrating and flow-breaking—lack of support for certain special characters on my (Croatian) keyboard layout. Characters like left double quotation marks (curly quotes), and horizontal ellipsis (, ) don't have keys dedicated to them.

Croatian keyboard layout

Compose Key can help some Gnomers

Compose Key is commonly recommended to solve this problem. So I tried it out but I couldn't make it work without messing up some other key combination. I'm documenting the method here because Compose key may be useful to other Gnome users with a different keyboard configuration.

You can find Shortcuts preferences in your Keyboard System settings. One of the options there is Compose key. It is disabled by default, but you can set it to Right Alt, Right Ctrl, Right Win, Left Ctrl, Menu (in between Right Alt and Ctrl) or Caps Lock.

Compose Key option on Keyboard System Settings

The exact place in my settings is System settings > Keyboard > Shortcuts > Typing > Compose key.

To type curly quotes you have to remember the key sequence and which keys to keep pressed down at which times. The first step it to press the key you have set up as your Compose Key, keep it pressed down while pressing the key (or a combination thereof) you usually press to produce the < character, and release both. Nothing is being typed at this point, you have only told your system to wait for more input before it would know which character you want to have typed in the end. The second step is to press the key (or a combination thereof) you usually type to get the " character (straight double quote).

Step 1 Step 2 Result
Compose + < "
Compose + > "
Compose + < '
Compose + > '

For me on Croatian keyboard layout that looks like this:

Step 1 Step 2 Result
Right Alt + < Shift + 2
Right Alt + Shift + < Shift + 2
Right Alt + < '
Right Alt + Shift + < '

So what is wrong with this approach? Too hard to remember the combinations? It's not ideal but that won't prevent me from learning to use them. Too cumbersome? Again not ideal but I was ready to incorporate it into my flow.

What I soon found out was that whatever key I used as my Compose key there were some key functions that had been disabled for me. Compose key seems possessive like that. The options are limited (I can't set whatever key I like) and I don't have some keys on my keyboard that are available as options (I have Functions key in between Right Alt and Ctrl which can't be used), for example I don't have Right Win or Menu key.

Compose Keys don't add without taking away first

Right Alt is used very often on Croatian layout to type @, {, }, [, ], \ and | characters. If I set Right Alt to be the Compose key I can no longer type those! And using a different Compose key also didn't help.

Right Ctrl is used several gazillion times a day to save your work (Right Ctrl + S) and I use it to zoom in and out a lot (Right Ctrl + mouse wheel, for text size or in graphics editors) with the help of a mouse (I'm using my left hand). But with it hijacked, instead of saving my work I end up typing ß (German Eszett, scharfes S). I don't think even German typing people would prefer it over saving their work, not amusing.

If I set it to Caps Lock I can't use it to write all caps. Not that I shout that often online, but it's still not acceptable.

So I had to Disable the Compose Key.

Alternative keyboard layouts to the rescue

I don't know why I haven't thought of this sooner, it's so simple and elegant, very easy to use, and easier to remember than the Compose key combinations wilderness.

Although Croatian keyboard layout can't support all those lovely keys I'm used to using so often, other languages do have them on their layouts. I can use a different language keyboard layout even though my physical keyboard has Croatian layout printed on its keys.

German keyboard layout, for example, has more options, especially those that I often miss.

German keyboard layout

You can see both the left and right quotation marks on the B and N keys. They can be typed with Right Alt and B or N when German layout is active. Switching between layouts is done with a very quick shortcut Super (left Win key) + Space.

Switch keyboard layout

Even though the Space key is used to go into Gnome shell mode, it doesn't seem to mind to multi-task when it's kept pressed down and other keys get involved (or at least the Space key).

Since I've started using keyboard layouts in this way I can report I've been very satisfied! Switching feels natural and remembering a few keys in another layout was no issue. It took less than a minute of practice to memorize the keys and make switching keyboard layouts a part of my process.

This is, of course, an inevitable setup for any polyglot who works with more than one language at a time and needs to type in different languages across different documents. Translators usually use the option to remember which input type to use in different windows so if you need it, you can type in German in one and English in another without the need to switch keyboard input each time you switch to work in another open window.

Although I focused on Gnome/Linux in this article, switching keyboard layouts and remembering different input for different windows is possible on all platforms.

Quick tip for travelers and other situations when you find yourself working on another person's computer, or someone not used to your layout has to use your computer: just google the elusive character by its name (or find some keys or keyboard references online), copy and paste.

I sometimes have the same problem when connecting to a Mac from Linux through VNC, it can take too much time to figure out how to make the keyboard layout translate from Linux to Mac so I just google it to save myself the hassle. It can't work if you have to do some serious work, but it helps if you only need to type in a complex password.

If you'd like to read more info here is a good resource on other ways to tackle typing special characters on Ubuntu and Using alternative keyboard layouts.