?? tsc_test.c
字號:
/*********************************************
* *GEC2410B* *touch screen test
* *created at 2007-10-25
*********************************************/
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
typedef struct{
unsigned short pressure;
unsigned short x;
unsigned short y;
unsigned short pad;
}TS_EVENT;
int main(void)
{
static int ts=-1;
static int mousex=0;
static int mousey=0;
static TS_EVENT ts_event;
//touch screen
printf("touch screen test program\n");
printf("please touch the screen.\n");
ts=open("/dev/ts", O_RDONLY);
if(ts<0) {
fprintf(stderr,"Can not open screen!\n");
exit(1);
}
while(1) {
read(ts,&ts_event,sizeof(TS_EVENT));
if(ts_event.pressure > 0)
{
printf("mouse down:ts_event.x=%d,ts_event.y=%d\n",ts_event.x,ts_event.y);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -