因为习惯 Mac 下 cmd 键位,所以把 Linux 下 ctrl 和 alt 键位进行了调换。
src:http://xahlee.info/linux/linux_swap_control_and_alt_xmodmap.html
Create a file at ~/.Xmodmap. The file content should be this:
! -*- coding: utf-8 -*-
! 2013-02-04
! swap Ctrl and Alt keys
! here's the default setting on special keys
! xmodmap -pke | grep -P '(Control|Super|Alt|Menu)'
! keycode 37 = Control_L NoSymbol Control_L
! keycode 64 = Alt_L Meta_L Alt_L Meta_L
! keycode 105 = Control_R NoSymbol Control_R
! keycode 108 = Alt_R Meta_R Alt_R Meta_R
! keycode 133 = Super_L NoSymbol Super_L
! keycode 134 = Super_R NoSymbol Super_R
! keycode 135 = Menu NoSymbol Menu
! keycode 147 = XF86MenuKB NoSymbol XF86MenuKB
! keycode 204 = NoSymbol Alt_L NoSymbol Alt_L
! keycode 206 = NoSymbol Super_L NoSymbol Super_L
clear control
clear mod1
keycode 37 = Alt_L Meta_L
keycode 105 = Alt_R Meta_R
keycode 64 = Control_L
keycode 108 = Control_R
add control = Control_L Control_R
add mod1 = Alt_L Meta_L
Now, run this line in terminal:
xmodmap ~/.Xmodmap
网友评论