?? test-b-a.c
字號(hào):
#include <sys/stat.h>#include <fcntl.h>#include <stdio.h>#include <sys/time.h>#include <sys/types.h>#include <unistd.h> #include<time.h>main(){ int retval; int fileno; int ts, maxfd; int ret= 0,i,j; int number;int size; fileno = open("/dev/buttons",O_RDWR); if (fileno == -1) { printf("open device led errr!\n"); return 0; }/*if(select(fileno+1,NULL,NULL,NULL,NULL)<0){printf("select error");}*/ while(1) { number=0; size=read(fileno,&number,1);if(number!=0) { printf("read %d number\n",size); printf("key=%d\n",number); usleep(200000); }} close(fileno); return 0;}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -