I'm using 20.04 on a DELL Latitude 5501. I'm trying to make my numpad keys function exactly like the arrow keys. I've tried all the options in gnome-tweaks (compatibility and numeric keypad options). In most cases it works ok, but in various cases it doesn't. most important for me are the keyboard shortcuts: Right Arrow is really a right arrow whereas Right Numpad Arrow is "Right (keypad)", meaning a different key.

Is there a way (command, script, utility) to make the system take keypad keys exactly like the arrow keys (and for that matter also the navigation keys pgup pgdn home end)?

1 Answer 1


Create a xmodmaprc file:

keycode  79 =  Home   Home   Home   Home
keycode  80 =  Up     Up     Up     Up
keycode  81 =  Prior  Prior  Prior  Prior
keycode  83 =  Left   Left   Left   Left
keycode  85 =  Right  Right  Right  Right
keycode  87 =  End    End    End    End
keycode  88 =  Down   Down   Down   Down
keycode  89 =  Next   Next   Next   Next

To certify that the above keycodes are correct in your machine, launch xev, press the keys, and see the keycode they generate.

Load the file at every X login with xmodmap xmodmaprc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .