12

I use a Lenovo ThinkPad (X220i) and like all ThinkPad users, I swapped "control" and "function" in the BIOS. Now I bought an external USB keyboard by Lenovo with a similar keyboard layout as the internal one, but unfortunately, "control" and "function" are swapped only on the internal, but not the external keyboard. Can this be fixed somehow? Maybe using setxkbmap or xmodmap? I'm running Debian 9 (stretch) btw. if this matters.

Martin
  • 181
  • 1
  • 6
  • Just found this: https://forums.lenovo.com/t5/Displays-Options-and-Accessories/How-to-swap-the-Fn-and-Ctrl-key-on-ThinkPad-Compact-USB-Keyboard/td-p/1473020 Seems, I have to return the keyboard and buy something else. – Martin Mar 23 '18 at 14:07
  • I created [this new question](https://superuser.com/questions/1688250/how-to-map-fnleft-fnright-to-home-end-on-lenovo-external-keyboard) about mapping `Fn`+`←` & `Fn`+`→` respectively to `Home` & `End`. – Totor Nov 18 '21 at 16:05

3 Answers3

11

As of September 2020, swapping Ctrl and Fn is now possible without the hardware modifications described by Martin.

Instructions can be found here, courtesy of the OP, I will recount them for completeness:

  • Download the firmware updater from Lenovo, version 3.30 (the latest as of September 2020)
  • In a hex editor, change byte 0x74004 from 0xba to 0xf5 and byte 0x740BA from 0xf5 to 0xba.
  • Run the updater and flash the firmware to your keyboard.

This applies only to the USB version of the old TrackPoint Keyboard, called "ThinkPad Compact USB Keyboard with TrackPoint". It does not apply to the new "TrackPoint Keyboard II". Do this at your own risk.

Lesik2008
  • 211
  • 2
  • 3
  • Thank you very much for this answer! I wanted to buy the keyboard for many years but the swapped ctrl and fn was a deal breaker for me. – tom Jan 30 '21 at 00:28
  • This worked for me! Thanks a lot :-) – gonsalu Feb 01 '21 at 10:40
  • There's a problem I'm having with this approach: Some key combos don't work. Ctrl-Alt-UpArrow doesn't work at all. This could be a scan matrix key masking issue, in which case https://superuser.com/a/1310384/147880 is a more complete solution. Curious to know if anyone else observes non-working key combinations. – David Baird Feb 23 '21 at 23:14
6

Answering my own question:

Thanks to Lenovo forum user blackdot54 from Canada, there is a hardware modding solution, that works well for me:

https://forums.lenovo.com/t5/Displays-Options-and-Accessories/External-Thinkpad-Keyboard-KU-1255-switch-Fn-Ctrl-on-non-thinkpad-PC/m-p/2192639?page=3#3954879

You need

  • conductive silver paint and a very fine brush
  • a sharp cutter
  • adhesive tape
  • a small flathead screwdriver
  • optional: Ohmmeter, Q tips
  • mandatory: a little bit of serenity and a steady hand

Looks difficult on the photos, but it's not that hard.

Totor
  • 1,429
  • 13
  • 19
Martin
  • 181
  • 1
  • 6
  • Broken link, the good one seems to be https://forums.lenovo.com/t5/Displays-Options-and-Accessories/External-Thinkpad-Keyboard-KU-1255-switch-Fn-Ctrl-on-non-thinkpad-PC/m-p/2192639?page=3#3954879 – Nahuel Greco Jul 21 '21 at 02:15
0

maybe you dont need to return the keyboard...

you can try,

xev  

then carefully and logically, press the ctrl and then Fn keys.

and take note of the output when you press the ctrl and then Fn keys.

and then run the following commands: (worked for me SHOULD be the same for you )

 xmodmap -e "keycode 151 = Control_L"   ( changes Fn key to Ctrl func. ) 
 xmodmap -e "keycode 37 = XF86WakeUp"   (changes Ctrl key to Fn func. ) 

Hopefully it will help you, of course, if not, revert these back to the original settings

Sean Davey
  • 494
  • 4
  • 11
  • 2
    `xev` reacts on Control, but not on Function, unfortunately. No event there, it seems. Function only alters the keycode of other keys, if I understand `xev` output correctly. The `xmodmap` commands seem not to have the desired effect. – Martin Mar 23 '18 at 17:37
  • I see, worked fine for me on rhel7 on lenovo t450 but must be different in your case, im on mobile now but i will try one more thing i know of when i get home, will let you know. === and really, nothing happens when you start xev and press the Fn key? – Sean Davey Mar 23 '18 at 17:48
  • 1
    Did you change the behaviour of the internal keyboard or the one of an external USB keyboard? The keys on the internal keyboard do emit events, but not the Fn key of the external one. I tested this with two external Lenovo keyboards with the same result. – Martin Mar 23 '18 at 17:59
  • The behavior on Sean laptop is different compared to the external keyboard – Akira Yamamoto Nov 19 '20 at 23:05
  • Thanks for the update, only 2 years late. https://memegenerator.net/instance/63271408/captain-obvious-south-park-thank-you-captain-obvious-our-work-here-is-done – Sean Davey Nov 20 '20 at 17:02