I'd like to add set a functionality to the pair fn+right/left to be like in Mac - 'home' and 'end'. I don't mean to replace the 'home' and 'end' buttons - just adding another 'home'/'end' keys. The advantage is in writing/modifying text. I use the arrows a lot, and I also use the home and end buttons, but why jump to a whole new button? My left hand is already near the fn (function) key - ready to press control or shift.

How do I set this?



I definitely understand why you want to do this! Here's my bet what I have done:

Launch a terminal and run 'xev'. Place your mouse cursor over the Event Tester window and press fn+right/left. You should get a read-out like:

    KeyRelease event, serial 36, synthetic NO, window 0x5200001,
root 0xb2, subw 0x0, time 89989888, (98,124), root:(1007,175),
state 0x0, keycode 171 (keysym 0x1008ff17, XF86AudioNext), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

This is for my keyboard and fn+right. Find the keycode -- here it's 171.

Now go edit your .bashrc file in your home directory. It's hidden, so pres Ctrl+H in Nautilus to show. Then add lines

    xmodmap -e "keycode 171 = Home"
    xmodmap -e "keycode xxx = End"

where you replace the 171 and xxx with the obtained keycodes. Then save and close the file. Close all your terminals, open one, and you should be ready to go!

Now, there is one draw-back: you have to activate this on every boot. You do that by opening a terminal, and that's it. You can close it again immediately. Or you can try fixing it to do it automatically, as described here. I just run the terminal using a shortcut and then kill it...

  • 3
    The keycode for fn+right is the same as just pressing right (without fn). This is problematic, because I don't want to override my right/left key. – AlikElzin-kilaka Sep 27 '11 at 11:26
  • Well, then it may not be a "function key" (or what the correct term is). My arrows are, but they are also media keys. Then I don't know what to do, sorry. – Rasmus Oct 15 '11 at 16:31
  • Thanks anyhow. This is still a great way to change keyboard behavior :) – AlikElzin-kilaka Oct 16 '11 at 14:20
  • 1
    Event tester responds one key at a time. I don't understand how did you manage to get the code for pressing the two together. – BringBackCommodore64 Mar 1 '18 at 19:33
  • 1
    I cannot see any key output when clicking FN + arrow key. Does that mean that it's not possible to bind there anything ? – Jurosh Apr 17 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.