本文主要是介绍键盘事件的KEY_KP*比如KEY_KP7代表键盘哪个按键?,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
首先,使用evtest可以看到键盘支持的所有键码与键值:
eton@9d:~/feiji$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: AT Translated Set 2 keyboard
/dev/input/event1: Sleep Button
/dev/input/event2: Power Button
/dev/input/event3: Power Button
/dev/input/event4: Video Bus
/dev/input/event5: ImPS/2 Generic Wheel Mouse
/dev/input/event6: Dell AIO WMI hotkeys
/dev/input/event7: PC Speaker
/dev/input/event8: Dell WMI hotkeys
/dev/input/event9: HDA NVidia HDMI/DP,pcm=3
/dev/input/event10: HDA NVidia HDMI/DP,pcm=7
/dev/input/event11: HDA NVidia HDMI/DP,pcm=8
/dev/input/event12: HDA NVidia HDMI/DP,pcm=9
/dev/input/event13: HDA NVidia HDMI/DP,pcm=10
/dev/input/event14: HDA NVidia HDMI/DP,pcm=11
/dev/input/event15: HDA Intel PCH Line Out
/dev/input/event16: HDA Intel PCH Front Headphone
/dev/input/event17: HDA Intel PCH HDMI/DP,pcm=3
/dev/input/event18: HDA Intel PCH HDMI/DP,pcm=7
/dev/input/event19: HDA Intel PCH HDMI/DP,pcm=8
/dev/input/event20: HDA Intel PCH HDMI/DP,pcm=9
/dev/input/event21: HDA Intel PCH HDMI/DP,pcm=10
Select the device event number [0-21]: 0
Input driver version is 1.0.1
Input device ID: bus 0x11 vendor 0x1 product 0x1 version 0xab41
Input device name: "AT Translated Set 2 keyboard"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 1 (KEY_ESC)
Event code 2 (KEY_1)
Event code 3 (KEY_2)
Event code 4 (KEY_3)
Event code 5 (KEY_4)
Event code 6 (KEY_5)
Event code 7 (KEY_6)
Event code 8 (KEY_7)
Event code 9 (KEY_8)
Event code 10 (KEY_9)
Event code 11 (KEY_0)
Event code 12 (KEY_MINUS)
Event code 13 (KEY_EQUAL)
Event code 14 (KEY_BACKSPACE)
Event code 15 (KEY_TAB)
Event code 16 (KEY_Q)
Event code 17 (KEY_W)
Event code 18 (KEY_E)
Event code 19 (KEY_R)
Event code 20 (KEY_T)
Event code 21 (KEY_Y)
Event code 22 (KEY_U)
Event code 23 (KEY_I)
Event code 24 (KEY_O)
Event code 25 (KEY_P)
Event code 26 (KEY_LEFTBRACE)
Event code 27 (KEY_RIGHTBRACE)
Event code 28 (KEY_ENTER)
这篇关于键盘事件的KEY_KP*比如KEY_KP7代表键盘哪个按键?的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!