?? touch_test.c
字號:
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc,char * *argv)
{
int fd,count;
struct site {
unsigned short x;
unsigned short y;
}buf;
printf("touchscreen test ....\n");
/*open key device */
fd=open("/dev/TOUCHSCREEN",O_RDWR);
printf("fd = %x\n", fd);
if(fd == -1)
{
printf("Could not open touchscreen driver!\n");
return -1;
}
else printf("screen opened\n");
sleep(1);
while(1)
{
read(fd,&buf, sizeof (struct site));
printf("site: X=%x ,Y=%x \n",buf.x,buf.y);
printf("----------------------\n");
}
/*close led device */
close(fd);
printf("right end!!!!\n");
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -