AX Semantics Developer Blog
  • Home
  • Categories
  • Tags
  • Archives

Switch "Insert" and "End" key on a ThinkPad x240 with Ubuntu

If you want to have the F-Keys to be F-Keys by default (not only together with Fn) on a Thinpad x240 you're likely to activate Fn-Lock. The problem with this is, that the "End"-Key on the top right of the keyboard get's "Insert" then, which is pretty annoying as I use "End" frequently. The solution is to switch "End" and "Insert", so the "End/Insert" key will be "End" with enabled Fn-Lock. To do this create the file /etc/udev/hwdb.d/61-ThinkPad-X240-keyboard.hwdb and paste the following:

# ThinkPad X240: switch End and Insert keys (so that when Fn-Lock is enabled, End works without Fn).
keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX240:*
 KEYBOARD_KEY_d2=end
 KEYBOARD_KEY_cf=insert

After the next reboot "End" and "Insert" will be switched.

Article based on: http://www.thinkwiki.org/wiki/Category:X240

12.01.2016 Update: for Ubuntu 15.10

On Ubuntu 15.10 the above method seems not to work properly, so I figured out another way to map "insert" to "end":

xmodmap -e "keycode 118 = End"

Add the above line in a file that gets executed at startup (like .xinitrc or awesome WM's rc.lua) to map "Insert" to "End". You won't have an "Insert"-Key anymore, but for my part I don't need it anyway.

Tell us what you think about this. Is something unclear? Do you have questions or ideas? Leave your comments below.

Comments
comments powered by Disqus

  • « Pytz and strange timezones
  • How to fix autostart of docker on Ubuntu 15.04 »

Published

Apr 27, 2015

Category

Berichtsheft

Tags

  • howto 9
  • hwdb 1
  • thinkpad 1
  • ubuntu 2
  • udev 1
  • x240 1
  • AX Semantics Developer Blog - Technical stuff and learnings we had while developing the AX environment
  • Powered by Pelican. Theme: Elegant by Talha Mansoor