Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
3  
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

2 Answers 2

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.

keycode

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
fi

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 finally found the way to do this after hours of tests and fails :D

First of all install guile libs and xautomation:

sudo apt-get install guile-1.8-libs 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! Now log out from the session and log in again. It's working like a miracle ;)

share|improve this answer

Your Answer

 
discard

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.