Ubuntu – Difference left/right super button

12.04gnomeshortcut-keys

When I press my left Super key the gnome shell appears and when I press the right Super key it does not. Moreover pressing right Super + T does open a terminal at once, but when using left super I have to press the T twice, when I press the T only once it is similar to just pressing the T without holding Super left. This last point also occurs with other shortcuts that I defined (like Super+L, Super+E), but not with Super+Up/Down/Left/Right.

What I want is to press either Super key to get the gnome shell and to use either Super key in combination with T to open a terminal immediately (and similar with other shortcuts). I use Ubuntu 12.04 LTS and the gnome 3 shell.

Best Answer

xmodmap solution

I think you can do this using xmodmap, a tool to modify keymaps. Since my keyboard does not have a right Super key I cannot confirm this solution, so please leave a comment if it doesn't work.
All steps are done in a terminal

Print the current modifier map
Run

xmodmap

This should print the current modifier map which should like something like this

xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock      
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

The important line is the mod4 line, this line shows which key codes are mapped to the Super_L and Super_R key symbols.

Backup the key map
Before we change anything it is a good idea to backup the current key map, we can do this with

xmodmap -pke > ~/.xmodmap.orig

Now if anything goes wrong you can simply type

xmodmap ~/.xmodmap.orig

to restore your original key map. (If you made some serious mistakes and you cannot properly type anymore, a reboot also works)

Check current key map for the Super keys
Assuming that the Super keys have consecutive key codes (0x85 and 0x86 in this case) we can check the current mapping by running

xmodmap -pke | grep -wA1 $((0x85))

were of course you should change the 0x85 by the key code you have from your modifier map. This should give you

keycode 133 = Super_L NoSymbol Super_L
keycode 134 = Super_R NoSymbol Super_R

( the $((0x85)) converts the hexadecimal number to decimal)

Copy the behavior of the left Super to the right Super
As you can see from the previous step the right Super key has key code 134 but we want it to have the behaviour of the left Super key which has keycode 133. We can do this by remapping the key using

xmodmap -e "keycode 134 = Super_L NoSymbol Super_L"

Checking if it works
If you now do

xmodmap -pke | grep -wA1 $((0x85))

you should see

keycode 133 = Super_L NoSymbol Super_L
keycode 134 = Super_L NoSymbol Super_L

meaning that both keys now have the same behavior. Also the modifier map should have changed on the line with mod4, we can check this by running

xmodmap | grep 'mod4'

which should give

mod4        Super_L (0x85),  Super_L (0x86),  Super_L (0xce),  Hyper_L (0xcf)

And of course the shortcuts which you mentioned should work too!

Make mapping persistent
If it works, you can make sure that these settings are automatically applied when you boot. Run

echo 'keycode 134 = Super_L NoSymbol Super_L' >> ~/.xmodmaprc

to store your custom key mapping in the file ~/.xmodmaprc. Run

echo 'xmodmap ~/.xmodmaprc' >> ~/.xsessionrc

to make sure the custom key map is executed when your window manager loads.