答案1
例子:
xev -event keyboard
上述命令输出中的一行表示向上箭头键
state 0x10, keycode 111 (keysym 0xff52, Up), same_screen YES,
上述命令输出中的一行表示向下箭头键
state 0x10, keycode 116 (keysym 0xff54, Down), same_screen YES,
运行以下命令
$ xmodmap -e "keycode 111 = "
$ xmodmap -e "keycode 116 = "
$
使用以下命令检查
$ xmodmap -pke | grep Up
keycode 80 = KP_Up KP_8 KP_Up KP_8 KP_Up KP_8
keycode 151 = XF86WakeUp NoSymbol XF86WakeUp NoSymbol XF86WakeUp
keycode 185 = XF86ScrollUp NoSymbol XF86ScrollUp NoSymbol XF86ScrollUp
keycode 233 = XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp
keycode 238 = XF86KbdBrightnessUp NoSymbol XF86KbdBrightnessUp NoSymbol XF86KbdBrightnessUp
$ xmodmap -pke | grep Down
keycode 88 = KP_Down KP_2 KP_Down KP_2 KP_Down KP_2
keycode 186 = XF86ScrollDown NoSymbol XF86ScrollDown NoSymbol XF86ScrollDown
keycode 232 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown
keycode 237 = XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown
$
xev -event keyboard
结果
KeyRelease event, serial 28, synthetic NO, window 0x3000001,
root 0x105, subw 0x0, time 396765, (1224,931), root:(1274,1011),
state 0x10, keycode 111 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 28, synthetic NO, window 0x3000001,
root 0x105, subw 0x0, time 397693, (1224,931), root:(1274,1011),
state 0x10, keycode 116 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False