Skip to main content

Alternative Keyboard Layouts

The majority of people are typing on some variation of the QWERTY layout. Where does it come from? Have you ever wondered if there are better alternatives to it? If not, there is a completely new world for you to discover!

QWERTY Keyboard Layout

Let us first understand where the common keyboard layout has its roots. It originated somewhere around the 1870s together with the first typewriters. The very first model of the typewriter had letters simply arranged in alphabetical order. However, it took improvements over many iterations until it lead to the common QWERTY layout to meet the challenges regarding moving mechanical parts.

One problem with typewriters is their type bars. Those can jam if neighboring mechanical elements were pressed at the same time. Therefore, often used letters like e, n and letters in digraphs like st were placed far apart. Apparently, typing some of the longest words like “typewriter”, “proprietor”, “perpetuity” and “repertoire” on the top row was also of concern.

The mechanical challenges of the typewriter are also responsible for the staggered layout. The QWERTY layout has keys not ordered like on a chess board, but rather shifted to allow the metal arms pass between each other. This is a story for another time, however.

At some point computers came along and with them the restrictions regarding mechanical parts dropped away. Nevertheless, they had adopted the very same layout to facilitate the migration process in the early days, since they were used for the same tasks as typewriters.

Mechanical keyboards have almost disappeared, but the modern replacements on every modern keyboard are still influenced by those challenges in the stone age, completely in the sense of path dependence.

With keyboard layouts beyond English things got even worse. Take the German QWERTZ layout for example. It needs some more keys for the umlats and the sharp s. As a consequence, often used characters for programming were moved far away from the home row. To reach ‹[›, you need to grap over half the keyboard with one hand 1. This obviously has lead to a suboptimal layout for writing applications.

tl;dr

The QWERTY keyboard layout is brought to you by the stoneage. It is influenced more by mechanical challenges than by Fits' Law. It remains the most used layout only due to path dependence.

Modern Alternatives

Already in 1936 Dvorak had proposed an alternative keyboard layout. It increased the number of words you can type on the home row from 32% on QWERTY to 70% on Dvorak. The second best known alternative is Colemak from 2006, which increased the words on the home row to 74%. It also replaced ‹CAPS_LOCK› with an additional delete key. This is very well possible, since ‹CAPS_LOCK› is the least used key on the keyboard. The only thing both do is to shift the keys on the keyboard around to increase typing speed and comfort. In fact, there are quite a few layouts for different languages.

However, as a developer you do not only care about typing speed of text, but how effortless you can write an application. You need direct access to all those characters used for programming. Along comes Neo2. Neo2 introduced the concept of layers. Now that ‹CAPS_LOCK› is put into actual use by giving you access to brackets and parentheses directly on the home row! All those characters needed for development are not scattered on the edge the keyboard any more, but are available right there where your fingers are ready to use them.

Imagine having / directly on the home row typing a Unix path! Imagine having all those brackets, parentheses, braces and other characters used in your programming language easily accessible, without having to glance at your keyboard! Imagine special characters like , , , » and be accessible in the same manner! Also, Neo2 provides you with arrow keys, ‹esc›, ‹del›, ‹tab› and numbers all in the center of your keyboard, so you do not have walk to the horizon in order to use them.

There are further German-oriented alternatives to Neo2 like the lesser known bone2. However, most still share the same idea of having additional layers for programming. The only difference is their key arrangement 3.

tl;dr

There are alternatives to QWERTY that are better suited for programming, the best known of which are Dvorak, Colemak and Neo2. Neo2 adds characters for programming and control characters like ‹esc›, the arrow keys and numbers on the home row and in vicinity of it.

Platform Support

Before even considering alternative keyboard layouts, you need to know how far your system can be taken. So, let us look at the support for those on Windows and Linux.

Linux

Switching the keyboard layouts on Linux is straightforward. Since 2006 Neo is included. Other layouts like bone2 are also included since a couple of years. I will provide a concise overview over the basic commands only. Using X11 or Wayland with xkeyboard-config the only command to issue is

$ setxkbmap de neo

for the Neo2 layout, as an example. The first parameter is the layout. You can list available layouts with

$ localectl list-x11-keymap-layouts

The second parameter is the variant. For a given layout like de you can list available variants through

$ localectl list-x11-keymap-variants de

Note that the resulting list is not exhaustive, as bone2 is not listed, although you can load it anyway. Consulting the configuration files directly is probably a good idea to get a sense of supported layouts. Regarding /dev/tty[0-9], available key maps can be listed via

$ localectl list-keymaps

One particular can then be loaded through the same command you probably have used during the installation.

$ loadkeys de

That is enough for you to get started. Consult the documentation for your Linux distribution to make the layout persisting and to get familiar with additional options. Note that even if your favorite keyboard layout is not among the supported, you still can adjust the configuration files to your taste.

Windows

Things are not that easy on Windows. There are basically three options you can try, but all of them have their limitations.

Microsoft Keyboard Layout Creator

lets you to modify the positions of keys on your keyboard. However, it does not support multiple layers. Those are not needed if you use something like Dvorak or Colemak, but this is quite limiting if you use something more extended. It is not possible to have an additional layer with common signs in programming using this method. You probably would need to sacrifice other keys for that. Moreover, according to a trustworthy source, the resulting key codes might require a manual fix.

The driver for Neo2

makes the Neo2 layout available, but only that one. If you use any other keyboard layout, you would need to modify and recompile the driver. I have tried this method, but have not reached the end because of time constraints. Probably it works out for you. Also, you need permissions to actually install drivers on your machine, which might be not a given. Moreover, the driver still needs an Auto-Hotkey script on top, because the Windows Driver Kit is not flexible enough for the driver’s full functionality.

Auto-Hotkey stand-alone script

makes Neo2 available along with some others. It also supports the definition of a custom layout and is more flexible overall. With this method it might be even possible to keep QWERTY or QWERZ while adding new layers for programming.

Obviously, you need Auto-Hotkey to be available on the machine. On the software side it worked out the best in my case. The huge disadvantage of this method is that layers would jam occasionally, especially in presence of anti-virus software 2. It is like someone would press ‹CAPS_LOCK› occasionally to interrupt you. I suspect that this is due to the anti-virus checks causing the script to lose key status events, but I have not investigated this.

Note that this method makes the keyboard layout not available for the whole system. You still would need to log in using any natively supported layout. Also, this does not work in applicaitons run as administrator.

In conclusion, no really good solutions exist for Windows currently. There are some options, but they get you only that far.

tl;dr

Linux has great support for everything you might wish. On Windows things are a bit different. Dvorak and Colemak should be supported, potentially after a manual intervention. Neo2 should be supported under some constraints.

Considerations

You have verified that your operating system has enough support for the alternative keyboard layout of interest. This is a prerequisite, but by far not the only consideration one needs to make before changing the default key map. So, here is a list of things you need to be aware of.

It is an all-in process.

There are no attempts in switching the keyboard layout. There is also no granular key-by-key switching. If your intent is to permanently use another keyboard layout, you will need to make it the system’s default and stick to it until the end. There is no easy returning to QWERTY and you will see the benefits not until the end of the migration.

Switching takes much effort.

In addition to the extended migration phase, it is pretty difficult by itself. Firstly, it takes weeks and months 4. You will need to forget the layout you have been using for all those years. This is easier said than done. After that there will be a phase in-between, in which you will have forgotten your former layout, but will not be familiar enough with your new one. Therefore, over quite an extended period of time, you will be not able to be productive. It is absolutely crucial to have the motivation to reach the end nevertheless.

You will be not able to type fast on a default layout any more.

Once performed the migration, you will not be able to efficiently type on the keyboard layout used by everyone else. Sure, you will be able to search for the keys on the keyboard, but you will have to pick those one-by-one. If you need to type on many different machines using QWERTY, you should stick to the default. Also, if you believe that you rather want to perform good on many machines instead excellent on one, you also should stick to the default.

You have to change your system configuration.

Many applications rely not only on mnemonics for their shortcuts, but also on the position of keys. Take nvim as an example. The keys for cursor movement are nicely placed on the right side of the home row by default. After the migration they will be scattered around the keyboard. So, while you are learning another keyboard layout, you also might need to change and learn different mappings for your applications. Furthermore, it is difficult to anticipate all the changes required. At some point you will need to change the mapping of keys as it becomes obvious. Have you thought about less? It is actually a very good example, since the key mappings need to be compiled, which is not a standard for Linux applications. Finally, as soon as you install another application, you need to be ready to dive into the configuration first to ensure it is good enough for your layout.

The switch might be challenging on Windows.

If I used Windows while migrating to an alternative, it would have been a very negative experience. I rely very much on the robustness of the input process. I do not want to deal with keys that are working only part time. In similar fashion, I especially do not want to deal with occasionally sticking layers. Probably there will exist some better solutions for Windows at some point or I have not considered everything, but the usage of modern, alternative keyboard layouts might be challenging on Windows at the time of writing.

Studies on the subject are inconclusive.

Note that there are some studies on the usage of alternative keyboard layouts and the general conclusion is that those are not conclusive. So, if you are making your decision based on science, alternatives to QWERTY are not as backed up by it as it might look like at first.

tl;dr

The migration process to an alternative keyboard layout is a long and difficult path. You need the motivation to go through the complete process nevertheless to see benefits.

Result

Most likely you ask yourself why crazy people would choose an alternative despite challenges.

Having switched to an alternative layout is one of the best things I have done along with learning vim. It allowed me to improve the performance of the interface between me and the machine. Now, I am able to inject my thoughts directly and without friction into it, instead of discussing what compromise we both like to have.

The additional keys on the home row are fantastic. Where I struggled with QWERTZ before, I am now flying writing code. I do not have to think how to write code, but what code I want to be written. I can use extended symbols like directly on the keyboard. Moreover, I can even use those to add new mappings. For instance, it makes perfect sense to map something like <m-(>, since ( is on the home row. That way I can extend possible shortcut combinations in pretty much every application I use, including nvim and neomutt.

Also, having all the keys like ‹esc›, ‹tab›, numbers and control arrows directly under my fingers I can easily navigate in every application without having to search for them by touch or taking my view from the screen.

I believe that with all those possibilities provided by alternative keyboard layouts, one is able to provide better solutions overall. Reason for that is the more streamlined process, in which there are no friction to get your thoughts into the machine.

Conclusion

QWERTY sticked with us as the very first working layout for typewriters. Since then, constraints have dropped and alteratives have emerged. Would I suggest those in general? Probably not. The effort to migrate to an alternative is simply too high.

However, for a small set of perfectionists dedicated to improving their interface to the machine, it might be worthy. In the end, you are able to put all your focus on code rather than searching for keys placed in unfortunate positions. That in turn ensures your concentration and leads to better solutions.


1

On the German QWERTZ especially the keys for letters [, ], {, } and \ are hard to reach. This is the reason why I started to use QWERTY at some point. It provides those keys in a more accessible manner. The German-specific letters are not necessary for writing code and comments in English.

2

Also called snake oil in some parts of the internet.

3

The exact differences between different alternative layouts are beyond the scope of this post. However, I would like to provide some spoilers. Neo2 is the last layout that was assembled manually. After that people started to develop algorithms to take many additional factors into account. Also, the philosophies behind layouts are different for each layout. Some prefer the focus on the center of the keyboard, others on the home row instead.

4

I am assuming that you are typing blindly on your current keyboard layout already. The process is most likely easier if you are learning an alternative layout as your first.