use xenv
to capture the keys which you want to replace
- Get original key mapping using
xmodmap -pke > ~/keymaptable
$ cat ~/.Xmodmap
! -*- coding: utf-8 -*-
! swapped 49 with 94
keycode 94 = grave asciitilde dead_circumflex degree U2032 U2033 grave asciitilde
keycode 49 = less greater less greater bar brokenbar bar dead_belowmacron
Reload after applying the config
xmodmap ~/.Xmodmap
Create this file to make sure its read when x11 starts
$ cat ~/.xinitrc
if [ -s ~/.Xmodmap ]; then
xmodmap ~/.Xmodmap
fi
create file
cat ~/.xinitrc
xmodmap .Xmodmap
cat ~/.Xmodmap
clear control
keycode 94 = Control_R
keycode 37 = Control_L
keycode 105 = Control_L
add control = Control_L Control_R