Ubuntu – How to map right-Ctrl to Fn

keyboard-layout

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

Best Answer

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.