The art of typing
typing = the main human computer interface
Surprisingly the main interface from a human to a computer for interaction - the keyboard - is highly underrated. Beside of geeks dedicated to building their own mechanical keyboards most people don't care about their keyboard. I've seen most expensive gaming-rigs, with sophisticated gfx-cards setup, CPUs being overclocked and tuned, strangest water cooling systems, etc - but connected to a really, really, bad keyboard.
But - as soon as a heavy typist encounters a "typing injury", RSIs you'll have to start to think about your typing habits, your keyboard, your keyboard layout, etc.
About 20 years ago I unfortunately developed RSI in my hands. I was rather afraid, as typing is the foundation of my job, communication and even most of my hobbies.
Fortunately I got rid of any symptoms, following the path I took.
remap CAPSLOCK to CTRL
Honestly - have you ever used the CAPSLOCK key? This is one of the most useless keys on your keyboard. Remapping f.e. CTRL to CAPSLOCK is one of the first advice that you get, asking about RSI, especially if you are using emacs.
For VIM users, probably remapping CAPSLOCK to ESC is also an option.
There are various ways to do the mapping:
- some operating systems offer out of the box an option for that in their system settings (f.e. MacOS)
- gnome and kde offer also a choice in their specific settings
- otherwise on X-window you can utilize xmodmap
most layouts selectable by setxkbmap have an option like "ctrl:nocaps", so, to get german dvorak with CAPSLOCK as CTRL:
setxkbmap -layout de -variant dvorak -option ctrl:nocaps
make CTRL also do ESC, get rid of ALT
Next step - hitting the CTRL key without pressing another button - should do ESC. That way (at least for me as a heavy emacs user) I have my most importan modifier keys cerntered on one physical key!
As ESC makes (nearly) also the ALT key obsolete (at least in emacs-world, as META key is either hitting first ESC or holding ALT down) I mapped additionally my ALT keys to CTRL.
So, on most keyboards this gives me at least 3-4 alternatives to push CTRL, or rather ESC, helping to spread the burden on the finger to hit these modifier keys:
- actual CTRL-keys
- ALT-key (near to the space bar)
- CAPSLOCK
For that in X11-world you can use xcape, f.e. if you put into your .xsession:
xcape -e "Control_L=Escape;Control_R=Escape" &
dvorak - my variant
A remnant of the typewriter is the qwerty layout of current keyboards. Have you ever asked yourself what is the reason for the specific layout of qwerty?
According to Wikipedia, one of the reasons was to avoid clashing of the type bars by placing commonly used combinations of of letters farther from each other. Not really an ideal idea from ergonomics's point of view of modern computer keyboards?
There have been various attempts to come up with better ideas, f.e.
Actually I can't remember, why I specifically settled with the German Dvorak layout about 20 years ago. Probably I liked the idea of having all vowels in one row on my left fingertips.
from wikipedia
Unfortunately the german dvorak variant is not out of the box included in every operating system.
- Linux
- console: must distributions should have dvorak-de.map.gz, just
have a look into
/usr/share/kbd/keymaps/i386/dvorak/
. - X11: german dvorak variant is available for many years, just use the system settings of your desktop environment (KDE, Gnome, XFCE, …), or put above mentioned setxkbmap into your .xsession / .xinitrc.
- console: must distributions should have dvorak-de.map.gz, just
have a look into
- MacOS
- get
german dvorak type ii.dmg.bz2
from http://www.halibrand.de/dvorak/ and follow the instructions.
- get
- Windows
- as I try to avoid Windows, just from hearing: https://www.conitzer.de/index.html?/dvorak/layouts.html should provide what you need.
adapting the layout
Over the years I've started to adapt the standard german dvorak layout to my needs.
As my main target platform is X11, how to adapt you keyboard layout in
X11? You'll find various tutorials about that in the net. Most of them
show how to adapt the (rather complex) files in
/usr/share/X11/xkb/
. But for that you have to be root and you are
changing system-files, having the danger of being overwritten by
package-updates of your distribution. Also I wanted to have my
selection of keyboard layout be part of my dotfile-repository, so that
I can roll it out to other machines, without having root access.
Really enlightening, as usual, the archwiki:
- https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration
- https://wiki.archlinux.org/title/Xorg/Keyboard_configuration
I stumbled over xkbcomp
, I haven't heard about before. You can fetch
your current layout into a *.xkb file, adapt it, and put it into
action. It is actually part of any modern X11 base package.
So, first I had set my current layout to standard german dvoark, with swap of CTRL key as basis for my changes:
setxkbmap -layout de -variant dvorak -option ctrl:nocaps
then I saved this config into a file:
xkbcomp -xkb "$DISPLAY" keymap.xkb
Then I edited keymap.xkb, afterwards running
xkbcomp keymap.xkb "$DISPLAY"
loads the definitions of keymap.xkb. Putting it into my .xsession file takes care that my adapted layout gets loaded each time I sign into a X11 session.
The format of keymap.xkb is rather easy to grok, if in doubt, look
into the man pages but also into /usr/share/X11/xkb/
, keymap.xkb is a
kind of substrate of this directory for your specific layout in one file.
my changes
Controversial opinion: Honestly, no keyboard should have more than 3-4 rows! If you are touch typing, reaching out to the numbers in the top row, especially in the middle, or even the function keys above, that is bad.
The German keyboards have a specific modier AltGr
, that is mostly used
just for €
and the @
. So, I put most of the keys in the "number-row":
^1234567890+<
reachable via AltGr
.
If I really need any of the other symbols, that are normally reachable
with the AltGr
modifier, I put them into my .XCompose
- see my blog
post about APL-symbols and the .XCompose
file.
base layer
tab | ü | , | . | p | y | f | g | c | t | z | ? | / | - |
ctrl / esc | a | o | e | i | u | h | d | r | n | s | l | enter | |
shift | ö | q | j | k | x | b | m | w | v | ' | shift | ||
ctrl / esc | fn | super | ctrl / esc | space | AltGr | ctrl |
shift layer
tab | Ü | ; | : | P | Y | F | G | C | T | Z | ß | \ | _ |
capslock | A | O | E | I | U | H | D | R | N | S | L | enter | |
shift | Ö | Q | J | K | X | B | M | W | V | # | shift | ||
ctrl | fn | super | alt | space | AltGr | ctrl |
AltGr layer
tab | @ | ¨ | . | 7 | 8 | 9 | ż | bar | | ||||
capslock | ( | [ | ] | ) | 0 | 4 | 5 | 6 | ś | ł | enter | ||
shift | ä | @ | { | } | 0 | 1 | 2 | 3 | shift | ||||
ctrl | fn | super | alt | space | AltGr | ctrl |
final thoughts
I have only talked about technical solutions to mitigate RSI. But - most important take care of your self!
- Make breaks! Don't sit more than 1-2 hours in front of your computer. Make a break. Do some steps, play an instrument, or whatever gives you relief.
- Enjoy nature! Some steps in the woods, fresh air, even some rain drops on your head do wonders.
- Eat healthy! Eating habits have a big influence on our life. Not only quality of food is important, also the way we consume it. Take your time for your food. Try at least once per day to prepare / cook your food on your own. Don't eat in front of your computer, again doing some work.
- Who hasn't encountered the situation: late in the evening, either a great game or serious work forces you to stay up late into the night in front of your computer. Even if you seem to enjoy it - if you do it too often, it is really bad for your health!
Take care!