February 9, 2020

Change your Cursor Pad into a 10 Key

I use spreadsheets a lot. If it's not text it's a formula. And all formulas begin with an equal sign.

To make my life a lot easier I decided that I wanted that equal sign to be on the cursor pad and I wanted the cursor keys to be numeric. I needed to remap them. Adiós, NumLock, hello equal sign. Now, let's reclaim those digits.

xmodmap is my new hero. Here's how to do it.

Put the following mappings into a file, name is up to you (I chose .kbrc), and append the line,
"source ~/your_filename", to your .bashrc file.

xmodmap -e "keycode 77 = KP_Equal KP_Equal KP_Equal"
xmodmap -e "keycode 90 = KP_0 KP_0 KP_0"
xmodmap -e "keycode 87 = KP_1 KP_1 KP_1"
xmodmap -e "keycode 88 = KP_2 KP_2 KP_2"
xmodmap -e "keycode 89 = KP_3 KP_3 KP_3"
xmodmap -e "keycode 83 = KP_4 KP_4 KP_4"
xmodmap -e "keycode 84 = KP_5 KP_5 KP_5"
xmodmap -e "keycode 85 = KP_6 KP_6 KP_6"
xmodmap -e "keycode 79 = KP_7 KP_7 KP_7"
xmodmap -e "keycode 80 = KP_8 KP_8 KP_8"
xmodmap -e "keycode 81 = KP_9 KP_9 KP_9"
xmodmap -e "keycode 91 = KP_Decimal KP_Decimal KP_Decimal"

If for some reason the remappings aren't working just type "source ~/your_filename" and hit "return".