I used to have a Lenovo N500, in this laptop the PgUp and PgDn keys are next to the Up/Down/Left/Right keys. Now I have a Lenovo T420 and the keys next to Up/Down/Left/Right are Back and Forward.

I would like to know how to remap the Back and Forward keys to function as PgUp and PgDn.

2 Answers 2


It can be made just typing the following command

xmodmap -e 'keycode 166=Prior' && xmodmap -e 'keycode 167=Next'

An alternative version of @miguelmorales85's answer (may be a bit more robust):

xmodmap -e 'keysym XF86Back = Prior' -e 'keysym XF86Forward = Next'
  • This answer worked for me in Xfce + Compiz, the other one didn't! Commented Jun 24, 2020 at 11:48

You must log in to answer this question.

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