- 论坛徽章:
- 0
|
基于gpio的按键驱动使用evtest测试是好用的,(只有两个按键 键码为键盘上的 左 右 键的键码)
如何才能实现我在控制台终端上按左右键的效果,即串口控制台上我按动左右键光标在超级终端上左右跑
我按动我做的开发板上的两个按键,超级终端上的光标也左右跑呢?
[root@localhost /usr/app]# ./evtest /dev/event0
Input driver version is 1.0.0evdev.c(EVIOCGBIT): Suspicious buffer size 511, limiting output to 64 bytes. See http://userweb.kernel.org/~dtor/eviocgbit-bug.html
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
Event type 0 (Sync)
Event type 1 (Key)
Event code 105 (Left)
Event code 106 (Right)
Event type 20 (Repeat)
Testing ... (interrupt to exit)
Event: time 1297342095.399174, type 1 (Key), code 105 (Left), value 1
Event: time 1297342095.399199, -------------- Report Sync ------------
Event: time 1297342095.509157, type 1 (Key), code 105 (Left), value 0
Event: time 1297342095.509175, -------------- Report Sync ------------
Event: time 1297342098.031100, type 1 (Key), code 106 (Right), value 1
Event: time 1297342098.031122, -------------- Report Sync ------------
Event: time 1297342098.103819, type 1 (Key), code 106 (Right), value 0
Event: time 1297342098.103835, -------------- Report Sync ------------
Event: time 1297342100.279170, type 1 (Key), code 105 (Left), value 1
Event: time 1297342100.279194, -------------- Report Sync ------------
Event: time 1297342100.469159, type 1 (Key), code 105 (Left), value 0
Event: time 1297342100.469177, -------------- Report Sync ------------
Event: time 1297342103.234875, type 1 (Key), code 106 (Right), value 1
Event: time 1297342103.234898, -------------- Report Sync ------------
Event: time 1297342103.479073, type 1 (Key), code 106 (Right), value 2
Event: time 1297342103.479088, -------------- Report Sync ------------
Event: time 1297342103.519089, type 1 (Key), code 106 (Right), value 2
Event: time 1297342103.519104, -------------- Report Sync ------------
Event: time 1297342103.559076, type 1 (Key), code 106 (Right), value 2
Event: time 1297342103.559090, -------------- Report Sync ------------
Event: time 1297342103.599049, type 1 (Key), code 106 (Right), value 2
Event: time 1297342103.599065, -------------- Report Sync ------------
Event: time 1297342103.639077, type 1 (Key), code 106 (Right), value 2
Event: time 1297342103.639092, -------------- Report Sync ------------
Event: time 1297342103.666372, type 1 (Key), code 106 (Right), value 0
Event: time 1297342103.666388, -------------- Report Sync ------------
^C
[root@localhost /usr/app]# |
|