📄 gpio_keys_input_test.c
字号:
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <linux/input.h>int main( int argc, char *argv[] ){ int fd, i; struct input_event x; system("/bin/mknod /dev/event0 c 13 64"); fd = open("/dev/event0", O_RDONLY); if( fd < 0 ) { perror("open"); goto END; } for(;;) { printf("read gpio \n"); if(read( fd, &x, sizeof(x))) { printf("------------------%d %d %d\n", x.type, x.code, x.value); } }END: return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -