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.

Usually in Gnome and KDE it is only possible to define shortcuts with the Super key in combination with another key. But is it possible to use only the Super key as a shortcut, and how could I achieve this?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

Yes, you can. You can fill with Super_L to the shortcut you want, for example to use win key only for launching gnome menu :

open terminal, type :

gconftool-2 –set /apps/metacity/global_keybindings/panel_main_menu –type string “Super_L”

The gnome menu will lauch with windows key only.

share|improve this answer
    
This doesn't work in my case (Ubuntu 10.04). However it works, if I edit the panel_main_menu entry in the gconf-editor. –  xilix Oct 16 '10 at 13:39
    
You have en-dashes (looks like) and angled quotes rather than "plain" double quotes there, so copy-pasting this directly won't work. (However, no quotes are needed here.) –  Roger Pate Oct 16 '10 at 19:01
1  
gconftool-2 --set /apps/metacity/global_keybindings/panel_main_menu --type string Super_L –  Roger Pate Oct 16 '10 at 19:04
add comment

The Super key is a so-called modifier key, i.e., it is only meaningful in combination with some other key (it "modifies" the other key to report Super+key instead of just key). This makes it impossible to bind it to a shortcut with the System->Preferences->Keyboard shortcuts GUI without a tweak.

You can tell the system to not consider Super a modifier key any longer; then you will be able to map it to any shortcut you want.

  1. In a terminal, type the command xmodmap; it will output a few lines -- look for the one that has Super_L and Super_R in it. It should look like this:

    mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce)
    

    See the mod4 at the beginning of the line? That means that Super_L and Super_R (left- and right- Super keys) are bound to the 4th modifier (there are 8 in total).

  2. If you want to be able to bind the Super_R key, give the command (note the quotes!):

    xmodmap -e 'remove mod4 = Super_R'
    

    This tells X11 that right-Super should no longer be a modifier.

Note: These settings will not survive a reboot; you can make them permanent by creating a text file .Xmodmap in your home directory, and writing a single line to it:

 remove mod4 = Super_R
share|improve this answer
add comment

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.