How can I map right-Ctrl to Fn?

Dell XPS 13 running Ubuntu 14.04 LTS. I use the Home and End keys frequently. (Seems most people don't use these keys much anymore.) Unfortunately, because it's such a small computer, Dell put Home and End on top of the left and right arrow keys, requiring holding the Fn key down to get Home and End.

There's a Ctrl key right next to the cursor keys. I never use this key, as I have CapsLock mapped to Ctrl. I'd like it to behave as a Fn key so I can press Fn Left (Home) and Fn Right (End) using one hand.

Is there any way to do this?

EDIT: I ran both showkey and xev, as suggested by @A.B.'s comment, and the Fn key does not trigger any output. I have a feeling that means my request is impossible.

enter image description here


Install xautomation, we need the command xte

sudo apt-get install xautomation

and xbindkeys

sudo apt-get install xbindkeys

Create or edit the file ~/.xbindkeysrc

nano ~/.xbindkeysrc

and add the following lines

"xte 'key Home'"
 m:0x4 + c:113

"xte 'key End'"
 m:0x4 + c:114

Test with

killall xbindkeys
xbindkeys -f ~/.xbindkeysrc

The package xbindkeys installs a autostart entry

/etc/xdg/autostart/xbindkeys.desktop

No further things are necessary.


Unfortunately for you, the Fn is a dead key: that means all by itself, it doesn't have a scan code and only gives an additional scan code to other keys when pressed together with them.

You can see this when you go to tty1 and executing there:

showkey --keycodes

Any key you press will give you an output, except Fn, so mapping Fn to Ctrl is impossible.

However, depending on the hardware of your keyboard, Fn+ could be mapped to E.G. Ctrl+ but then you'd lose the functionality of both Ctrl keys...

(I tried it on my keyboard and there it's impossible as Fn+ and give the same scancodes...)