Ubuntu – How to remap the keyboard to create a lefthand numpad

keyboardremappingshortcut-keysxkbxmodmap

Like many smaller machines, my laptop's keyboard is missing a dedicated numpad.

I can generally type without looking at my keyboard, but I am unable to blindly type numbers with the number row. That's why I thought of converting the left side of my keyboard into a second-level numpad (e.g. Z = 0, X = 1. C = 2, V = 3, S = 4 and so on).

Another advantage would be the possiblity to quickly type numbers without taking the right hand off the mouse or moving the left hand across the entire keyboard.

Now I'm looking for a way to remap those keys to "create" the numpad, at best independent of the desktop environment, as I'm using multiple ones constantly. Also, it would be amazing if that mapping was portable, so I could set it up once and enable it for different keyboards/machines.

I know that it's possible to modify the keymap directly inside /usr/share/X11/xkb/symbols/, but those allow only three modifiers (Shift, AltGr (on European keyboards) and Shift + AltGr) and they're usually in use on the letter keys or require both hands to activate.

I thought of using either Super_L or a combination of Shift_L + Alt as modifier keys to access the numpad layer, since those combinations shouldn't be in use and are easy to reach with one hand.

How could this be accomplished?

Best Answer

I am into custom keyboards running QMK and such which allows to redefine every key and allows advanced behaviours such as layers. I recentley came across Kmonad which is a software tool which allows most of the same features. I haven't tried it myself, but this should allow you to hold down or toggle a key to activate a layer on which you can map numbers to the left side of the keyboard.

Here is a link to the github; https://github.com/david-janssen/kmonad

I think Kmonad is also included in a lot of recent distros so it might already be available in APT.