Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to disable Thinkpad back-forward keys

📅 2013-Aug-14 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ thinkpad, xmodmap ⬩ 📚 Archive

Thinkpad keyboards have back-forward keys which activate the back-forward action in browsers. However, they are quite irritating because they are placed right above the right-left arrow keys. Pressing them by mistake could make you lose the text you had painstakingly typed into a web form.

To disable these keys in the current session, type these commands at the shell:

$ xmodmap -e "keycode 166="
$ xmodmap -e "keycode 167="

To permanently disable them, create a .Xmodmap file in your home directory and add these lines to it:

! Create ~/.Xmodmap file
! Add these lines to the file
keycode 166=
keycode 167=

Note: This does not work in Ubuntu 14.04, where xmodmap has been replaced with xkb. I do not know of a solution to get this working on that version of Ubuntu.

Tried with: Thinkpad X201i and Ubuntu 12.04 LTS

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧