Remapping a Standard Keyboard

Image Source: Mac Rumors

 Table of Contents

As much as I enjoy using my ergonomic keyboards, sometimes I still need to use the built in keyboard on my laptop. Transitioning between the two drastically different layouts is no longer an issue, but I find myself having an itch of wondering whether it’s possible to improve the usability of a standard keyboard.

I personally find typing letters and numbers is actually not so bad; despite the row stagger causing my fingers to move around more than they would need to on a columnar stagger layout, it’s not the worst thing to deal with. The thing that bothers me more are the actions around text manipulation like selecting or deleting text by words or entire lines. The keys for these are at the peripheral of the keyboard, which causes me to move both my hands away from the home row whenever I need to do those operations, which is fairly often while typing.

With a bit of layer remapping that I adapted from using small form factor keyboards, I was able to achieve a layout that keeps my hands relatively centered around home row. It’s not a far departure from a standard layout, so the learning curve is low compared to other, more drastic layout changes to bring improved ergonomics to common keyboards.

The Goal

To enable keeping my hands close to home row as often as possible, I need to move a handful of key keys:

  • Top left: Escape
  • Top right: Delete/Backspace
  • Bottom left: Shift, Control, Option/Alt, Command
  • Bottom right: Left, Right, Up, Down Arrow Keys

Prior Art

Other efforts exist like SpaceFN or Home Row Mods to improve the usability of standard keyboards, but the issue I found is that they all modify frequently used keys. I find these customizations work best on keys that aren’t as commonly used during regular typing. On my split keyboard, I started using bottom row mods (where the modifiers are on ZXCV instead of ASDF) which I find work much better, but unfortunately on a standard layout, the bottom row is shifted quite far right which makes using it with the left hand more awkward.

After a bit of trial and error, I settled on a remapping that works for my workflow. I even went as far as replacing my daily split keyboard with the Apple Magic Keyboard for a few weeks, since my secondary hypothesis was whether it’s possible to make a standard keyboard ergonomic enough to avoid needing to buy and learn how to use a columnar-stagger split keyboard. Unsurprising spoiler alert: You can get close, but there are tradeoffs.

The Layers

Base

Main layer with three modified keys.

For the main base layer, only three infrequently used keys are changed:

  • Tab -> Tab when pressed, Control when held
  • Capslock -> Hold for Extend layer
  • RightAlt -> Hold for Nav layer

Additionally, I added a combo of J+K = Escape, which is especially useful for Vim.

Tab’s default behaviour doesn’t change, but holding it unlocks a new behaviour of acting as Control. Capslock and Right Alt are not used often (at least by me), so I opted to use those as the keys to activate the two new layers, “Extend” and “Nav”, which I’ll explain more in the following sections.

I considered using LeftCommand to toggle the layer as well, which would help with symmetry and also have both thumbs operating the layers, similar to how it works on typical split keyboards. But I use Command often, and Capslock is basically unused. I already had remapped it to be “escape when tapped, control when held” to improve ergonomics when using vim, since Capslock is in a prime location for the pinky to press while the rest of the fingers are free to move along the home row.

Extend: via Capslock

When the extend (previously capslock) key is pressed, it activates the other coloured keys.

With this layer, I can easily manipulate text with my right fingers on the arrow keys, and left fingers on the modifiers. This lets my hands stay on home row, where typically to do similar actions, I’d need to move both hands to the bottom corners to press the modifiers and the arrow keys.

For example, if I want to select a bunch of text, instead of moving my left hand to the bottom left of the keyboard to press Shift + Option, and my right hand to the arrow keys, I can just press S+D with my left hand, and one of H|J|K|L with my right hand for the arrow key.

In this layer, Spacebar also becomes Delete/Backspace, which avoids having to move my right hand to the top corner to delete text, as well as allowing my left hand to use Option or Command to easily delete by word or line.

I also added a few keys for browser navigation - browser forward/back, and next/previous tab.

If you don’t use macOS, you could consider remapping the Left Alt key to activate the left thumb layer instead, which would keep things symmetrical where both thumbs are used to activate layers.

One caveat is that putting Control on the Tab key is a little weird for vim motions. It’s not the most comfortable and takes a while to get used to, but I’m okay sacrificing a bit here to keep the arrow keys in an easily accessible place.

By activating this layer with the right thumb, the keys turn to mouse navigation (similar to QMK Mouse Keys) for those times when you just need to nudge your mouse a bit, e.g. to the next input box or adjacent window. Using a mouse or dedicated pointing device is still much more efficient, but it’s nice to have this option for other situations.

I also added cut/copy/paste here. Since I use a mouse with my left hand, this regains my ability to execute these operations with my non-mousing hand.

For moving mouse keys and navigating tabs. Also adding cut/copy/command so I can use it along with left mouse.

Karabiner Config

Making complex modifications directly with Karabiner isn’t the easiest, where it requires manually writing JSON, which can be error prone and finicky. There are other tools to make it easier to create configs, and I recently started using karaml.

The karaml_config.yaml looks like this (non-exhaustive), which then gets translated to Karabiner JSON format:

/base/:
  caps_lock: /extend/
  j + k: escape
  tab: [left_control, tab]

/extend/:
  # Vim motions, (x) means to include any optional mods
  (x) | h: left
  (x) | j: down
  (x) | k: up
  (x) | l: right

  space: backspace
  semicolon: enter
  
  ...

GokuRakuJoudo is another popular option, but I personally found the syntax to be confusing and too complicated for my simple mind to comprehend.

For those on Linux, keyd is quite simple to configure in a similar way. However, I haven’t quite figured out how to chord the combos in the extend layer (e.g. to execute Shift + Control + Left), which works fine in Karabiner though. So please comment if you know how to fix it!

[ids]
*

[main]
capslock = overload(extend, esc)
j+k = esc
tab = overload(control, tab)
rightalt = overload(nav, backspace)

[extend]
a = leftalt
s = leftshift
d = leftcontrol
f = leftmeta
h = left
j = down
k = up
l = right
space = backspace

[nav]
u = C-S-tab
p = C-tab
i = A-left
o = A-right

Closing Thoughts

All in all, this was a successful experiment in improving the usability of a regular keyboard, and I’ll definitely continue to iterate on this layout as needed. Use a dedicated split keyboard is still (probably) superior, sometimes you need to make do with what you have, and hopefully this helps anyone who’s on that journey.

Some resources referenced in this post:

Happy typing!