0

This is the result of xmodmap -pm:

control     Control_L (0x25),  Control_L (0x42),  Control_R (0x69), Control_L (0x85),  Control_R (0x86)
mod4        Super_L (0xce),  Hyper_L (0xcf)

I have this .xmodmap:

clear mod4
add control = Super_L

After I run this, it changes my command modifier list, but the windows key doesn't actually behave as control. Why? Can I fix this?

3 Answers3

1

As mentioned by @user2889981 in https://superuser.com/a/1193894/1032352, it can be done in Gnome Tweaks app. In Fedora 29 it's in Keyboard & Mouse > Additional Layout Options (button next to Overview Shortcut) > Ctrl position > check next to Swap Left Win with Left Ctrl

0

Ok, on my system

Version

~$cat /etc/fedora-release 
Fedora release 25 (Twenty Five)

Window manager

~$env | grep -i desktop
DESKTOP_SESSION=gnome
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
XDG_SESSION_DESKTOP=gnome
XDG_CURRENT_DESKTOP=GNOME

Keyboard settings

~$setxkbmap -print
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us+ru:2+us:3+inet(evdev)"   };
    xkb_geometry  { include "pc(pc105)" };
};

with more or less accurate physical representation of the keyboard (PC105) enter image description here

The command

setxkbmap -option altwin:ctrl_win

replaces 'win' key and makes it 'ctrl' key.

What has been changed after the executions is

~$setxkbmap -print
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us+ru:2+us:3+inet(evdev)+altwin(ctrl_win)"  };
    xkb_geometry  { include "pc(pc105)" };
};

I have one display, setxkbmap have display and device options, it may be important.

to clear options 'setxkbmap -option'
to restore options later seems to be better to use 'setxkbmap -query' instead of 'setxkbmap -print' before

more sophisticated replacement tricks with setxkbmap in the answer Adding custom setxkbmap options and in the complicated article.

Other possible replacements, according to the answer from Rebind Alt key to win using setxkbmap? are available to see with:

grep alt /usr/share/X11/xkb/rules/evdev.lst | grep win
MolbOrg
  • 212
  • 2
  • 9
-1

I was able to do that with gnome-tweak-tool. There is an option there in Typing section. in 'Ctrl key position' section select checkbox 'Swap Left Win key with Left Ctrl key'