1

I'm using xmodmap (in Linux Mint 19.3) to remap the physical PrintScr & Insert keys to Home & End (because the keyboard's actual Home & End are secondary functions under the arrow keys, which require a modifier Fn key). First, in ~/.Xmodmap:

 keycode 107 = Home
 keycode 118 = End

Then in Startup Applications:

bash -c "sleep 5; xmodmap $HOME/.Xmodmap" &

This works great. i.e. when editing text:

  • Insert (aka end) moves the cursor to the end of the line
  • PrintScr (aka home) moves the cursor to the start of the line
  • Shift+Insert selects the rest of the line
  • Shift+PrintScr...does nothing...?

That last line is the issue - although the keys have clearly been remapped, the "Shift+Home" combination is non-functional. Note that Shift+Home does work when performed with the default Home key (i.e. shift+fn+left), so this is unique to the remapped keys. I went through every item under Keyboard->Shortcuts & removed any that involved the PrintScr key, so I'm 99% sure nothing there is affecting it, but I can't for the life of me figure out how to get it working. Any tips would be greatly appreciated.

3
  • try xev | grep 'keycode' to see what happens when you press the remapped keys.
    – Max1
    Commented May 1, 2020 at 17:59
  • Listing Home twice worked!! Why on earth...? Anyway, if you'd like to post it as an answer I can accept :)
    – J23
    Commented May 1, 2020 at 18:31
  • @Metal450 I have written the answer with an explanation. Glad to hear it helped you!
    – Quasímodo
    Commented May 2, 2020 at 14:39

1 Answer 1

4

The first entry indicates to what the keycode will be mapped when no modifier is pressed. The second entry will be triggered when the key is pressed with the shift modifier (read more in this ArchWiki article). So, try this:

keycode 107 = Home Home
keycode 118 = End End
1
  • Perfect! Accepted :)
    – J23
    Commented May 3, 2020 at 19:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .