在Linux上重新映射Win,Ctrl和Alt键

用惯了Mac上的CMD + * 等操作,就习惯了左手大拇指这个组合键操作了,切换到Linux上必须要Ctrl各种小指不舒服。。。值得一提的是Mac上左侧按键顺序是control、alt/option、command,Ubuntu则是control、super、alt,Windows则是control、Win、alt。这里我们方便Mac用户起见,就把Ubuntu的control、super、alt映射为super、alt、control

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
vim ~/.Xmodmap

clear control
clear mod1
clear mod4


keycode 37 = Super_L
! left Ctrl becomes Super
keycode 64 = Control_L
! left Alt becomes Control
keycode 133 = Alt_L Meta_L
! left Win becomes Alt
keycode 108 = Control_R
! right Alt becomes Control
keycode 134 = Alt_R Meta_R
! right Win becomes Alt
keycode 105 = Super_R
! right Ctrl becomes Super


add control = Control_L Control_R
add mod1 = Alt_L Meta_L
add mod4 = Super_L Super_R

xmodmap ~/.Xmodmap即可!