2

I'd like to know how I can swap the right command key (Super_R) with the right alt key (ISO_Level3_Shift) on Ubuntu 14.04.

I'd be happy to know the bash command or the necessary lines a need to write in xkb . Maybe you also know a GUI solution allowing to remap keys?

So, the right ALT key yiels the followingin xev:

KeyPress event, serial 37, synthetic NO, window 0x5c00001,
    root 0xd7, subw 0x0, time 26406541, (573,569), root:(616,621),
    state 0x0, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

And the right CMD key yiels:

KeyPress event, serial 37, synthetic NO, window 0x5c00001,
    root 0xd7, subw 0x0, time 26614133, (241,590), root:(284,642),
    state 0x0, keycode 134 (keysym 0xffec, Super_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False
2
  • Install x11-utils and start xev in a terminal. Edit your question and add the output for the both keys.
    – A.B.
    Oct 26, 2015 at 18:42
  • @A.B. I've added the details and edited the question.
    – ndrizza
    Oct 26, 2015 at 21:32

2 Answers 2

0

Create the file .Xmodmap

nano /.Xmodmap

Add the new definitions

keycode 134 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift NoSymbol ISO_Level3_Shift

clear mod4
keycode 108 = Super_R
add mod4 = Super_R

Reaload xmodmap

xmodmap /.Xmodmap

And check with xev

KeyPress event, serial 36, synthetic NO, window 0x2600001,
    root 0x26b, subw 0x0, time 10943583, (116,83), root:(153,147),
    state 0x10, keycode 108 (keysym 0xffec, Super_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x2600001,
    root 0x26b, subw 0x0, time 11023111, (106,110), root:(143,174),
    state 0x90, keycode 134 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
1
  • This solution with Xmodmap works. But as mentioned in the question below xmodmap has been obsoleted.
    – ndrizza
    Sep 26, 2016 at 22:02
0

Xmodmap will not work; it has been obsoleted.

In gnome, I think that you can do what you want with gnome-tweak-tool (I think there is an equivalent unity-tweak-tool or similar for Unity):

g-t-t typing

...should be one of those options. To read the complete definition, due to a bug, you need to dig into the files /usr/share/X11/xkb/rules/*.lst --- i think the one interesting to you would be

altwin:ctrl_alt_win Ctrl is mapped to Alt keys, Alt is mapped to Win keys

from xorg.lst, which I suppose is the fourth one in the list.

I cannot check it, but maybe

setxkbmap -option altwin:ctrl_alt_win 

can work... from the usually useful arch page.

(and yes, xkb or at least its current status is a PITA. Complex, undocumented system which I am sure noone knows in detail. See the first quote here. ).

4
  • Unfortunately I the Unity Tweak Tool does not provide such a configuration. I'll try to dig in the /usr/share/X11/xkb/rules/..." files then.
    – ndrizza
    Oct 26, 2015 at 15:33
  • I don't really understand what to do with the files in that folder. I'd really like to avoid studying the whole xkb configuration? Does anyone have experience with it?
    – ndrizza
    Oct 26, 2015 at 15:37
  • @ndrizza , I added a bit to the answer --- a simple guess. Unfortunately, it's a (over?)complex thing.
    – Rmano
    Oct 26, 2015 at 15:59
  • Thanks for the useful link! I'll study the documentation there.
    – ndrizza
    Oct 26, 2015 at 16:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .