Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just purchased a Lenovo thinkpad and I am so proud of everything in it. It feels just as rock solid as the Linux kernel :P.

The problem is that Lenovo decided to remove the context menu key that is the key that does the right click stuff. They replaced it by a print screen key. My keyboard has its numeric part with some buttons above it. There is a magnifying glass key that I would like to remap to open the context menu or be the right click key. Is it possible to do this?

I've tried searching for other related questions but I only found Q&As on how to add options to the Nautilus context menu. I want to to map a physical key of my keyboard to open this menu. Just like before. It also appears that Dell is dropping this key in their inspiron keyboard. I dont know whats going on since I use the keyboard more than mouse.

Thanks in advance.

share|improve this question
Please install xbindkeys with sudo apt-get install xbindkeys. Then in a terminal run xbindkeys -k and type the key you want to change. Can you add the output to your question? – Seth Dec 31 '12 at 0:50
"NoCommand" m:0x50 + c:46 Mod2+Mod4 + l – Jhonnytunes Dec 31 '12 at 4:17
Who would want a Print Screen key where they'd expect a Menu key? I seriously wonder how drunk you are allowed to show up to work at Lenovo. Anyway, note that you don't need an .Xmodmap generated by xmodmap -pke to start with, you can as well just put your binding in an empty file. Also, look at what @Baha_hi found out below. – J. Katzwinkel May 16 at 16:24

It's a little bit complicated but you can do it. Follow these steps:

1.- Open a terminal and type xev

2.- Press the key you want to reconfigure. The output in the terminal will show you the «keycode». Write down this number.


3.- Type in terminal xmodmap -pke > ~/.Xmodmap

4.- Type in terminal nano ~/.Xmodmap

5.- Scroll down until you find the right keycode and add Menu NoSymbol Menu. For instance:

keycode 135 = Menu NoSymbol Menu

6.- Save this file (CTRL + x)

7.-Finally, type in terminal nano ~/.xinitrc

8.- Add this line

if [ -f $HOME/.Xmodmap ]; then
    /usr/bin/xmodmap $HOME/.Xmodmap

9.- Save this file (CTRL + x)

10.- Logout

Most of the information above comes from this ArchWiki article.

share|improve this answer
There is a problem. When I press the button 'l' is marked. I checked it at xev and it give me the 46 keycode which is assigned to the L l letter. Maybe it doesnt have a keycode a take one. – Jhonnytunes Dec 31 '12 at 18:05
@Jhonnytunes. Check that your keyboard layout is correct. You can change your model typing ` sudo dpkg-reconfigure keyboard-configuration`. – Ed Villegas Dec 31 '12 at 20:13
Still the same behaivor. I tried different thinkpad models and nothing. – Jhonnytunes Dec 31 '12 at 21:47
BTW my thinkpad is an E530c and doesnt appear in the keyboard list. – Jhonnytunes Dec 31 '12 at 22:32
If this is your keyboard layout, maybe the key next to «Delete» is actually «Context menu» (the function you are looking for). Otherwise, reconfigure another key or ask directly Lenovo's desk which layout you should choose. – Ed Villegas Jan 1 '13 at 1:51

I found here that using: shift+F10 opens the context menu.

I know it's not the best solution but I thought it could help for temporary use!

P.S: I have e530c too, and I tested this on Debian 7 (Wheezy).

share|improve this answer

I finally found the way to do this after hours of tests and fails :D

First of all install xautomation:

sudo apt-get install xautomation

Then head to the Shortcut tab of Keyboard section in Ubuntu System Settings. First go to Screenshots entry and remap the actions to another key or disable them if you want. I replaced PrtSc(Print) key by the Thinkpad black button (Launch1).

Now go to Custom Shortcuts section and add a shortcut. name it whatever you like, e.g. Menu. In Command field insert this:

xte 'keydown Shift_L' 'key F10' 'keyup Shift_L'

The work is done! It's working like a miracle ;)

share|improve this answer

Shift+f10 maps to a context menu on my Dell Latitude E4200, Ubuntu 14.04. Worth the try before changing the use of another key on your keyboard.

share|improve this answer
How is this different from the answer from Baha_hi? – guntbert Feb 20 '15 at 21:38
If this is not a definitive answer you should consider posting a comment. – Xweque Feb 21 '15 at 18:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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