ubuntu 按键替换 Control_R to Left
1 查看当前键盘布局
$xmodmap -pke
keycode 105 = Control_R NoSymbol Control_R
keycode 106 = KP_Divide KP_Divide KP_Divide KP_Divide KP_Divide KP_Divide XF86Ungrab
keycode 107 = Print Sys_Req Print Sys_Req
keycode 108 = Alt_R Meta_R Alt_R Meta_R
keycode 109 = Linefeed NoSymbol Linefeed
keycode 110 = Home NoSymbol Home
keycode 111 = Up NoSymbol Up
keycode 112 = Prior NoSymbol Prior
keycode 113 = Left NoSymbol Left
keycode 114 = Right NoSymbol Right
keycode 115 = End NoSymbol End
keycode 116 = Down NoSymbol Down
keycode 117 = Next NoSymbol Next
keycode 118 = Insert NoSymbol Insert
keycode 119 = Delete NoSymbol Delete
然后用xev |grep keycode命令,查看物理按键的代码。
$ xev |grep keycod
state 0x10, keycode 36 (keysym 0xff0d, Return), same_screen YES,
state 0x10, keycode 112 (keysym 0xff55, Prior), same_screen YES,
state 0x10, keycode 112 (keysym 0xff55, Prior), same_screen YES,
state 0x10, keycode 105 (keysym 0xff51, Control_R), same_screen YES,
state 0x14, keycode 105 (keysym 0xff51, Control_R), same_screen YES,
Control_R为105
Prior为112
2 touch ~/.Xmodmap
下面Control_R映射为left键值
输入
keycode 105=Left
3 然后执行:
$ xmodmap ~/.Xmodmap