I've wanted to remap my print key on my Thinkpad T460p because Lenovo decided it would be more useful than the context menu ("Menu" which is basically the right mouse-) button.

It tried a solution from this thread and did the following:


xev | grep keycode

and pressing the print key got me its keycode which is 107. The only difference to this thread is my keycode and I've set its value to "Menu". I've also edited .Xmodmap to keycode 107 = Menu NoSymbol Menu

It works setting it temporary but after a reboot it's gone. And yes I've edited the xinitrc too.

Is there an easier way maybe with the help of a GUI? I just want to use my print key as a context menu.

Thx everybody

  • Can be solved, but what is exactly the command you use? Feb 2, 2017 at 13:31

1 Answer 1


This is a long shot, but maybe adding sleep 5 to ~/.xinitrc, like this:

if [ -f $HOME/.Xmodmap ]; then
                sleep 5
                /usr/bin/xmodmap $HOME/.Xmodmap
        } &


It looks like ~/.xinitrc is not sourced in Ubuntu (with lightdm). Try ~/.xsessionrc instead.

  • That works. Thank you! Either it helped to add "sleep 5" or create the .xsessionrc file. It may also work adding sleep 5 to xinitrc but I didn't tried that :). Edit: Cannot upvote your answer because of my low reputation
    – Chronos90
    Feb 2, 2017 at 13:50
  • 1
    An example of a good long headshot :)
    – dgonzalez
    Feb 2, 2017 at 14:55
  • Weird if I close my Laptop it is gone and does not work anymore :( It works again if I reboot my Laptop
    – Chronos90
    Feb 3, 2017 at 17:47
  • @Chronos90: Take a look here: askubuntu.com/questions/661715/… Feb 3, 2017 at 18:23

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.