comparison touchTest/parseDevicesTest.c @ 4646:eea1bf53effa

Added include/touch.h Now reading in resolution of touch pad.
author Jim Grandpre <jim.tla@gmail.com>
date Tue, 01 Jun 2010 02:54:33 -0400
parents 0375d020e7e3
children
comparison
equal deleted inserted replaced
4645:0375d020e7e3 4646:eea1bf53effa
1 #include <stdio.h> 1 #include <stdio.h>
2 #include <stdlib.h> 2 #include <stdlib.h>
3 #include <linux/input.h> 3 #include <linux/input.h>
4 #include <fcntl.h>
4 5
5 6
6 int main(int agrc,char **argv) 7 int main(int agrc,char **argv)
7 { 8 {
8 FILE *fd; 9 FILE *fd;
20 if(vendor == 1386){ 21 if(vendor == 1386){
21 printf("Wacom... Assuming it is a touch device\n"); 22 printf("Wacom... Assuming it is a touch device\n");
22 sprintf(tstr,"/dev/input/event%i",event); 23 sprintf(tstr,"/dev/input/event%i",event);
23 printf("At location: %s\n",tstr); 24 printf("At location: %s\n",tstr);
24 25
26 int inFile = open(tstr,O_RDONLY);
25 27
28 unsigned long bits[4];
29 int abs[5];
30 ioctl(inFile,EVIOCGABS(ABS_X),abs);
31 int minx,maxx,miny,maxy,minp,maxp;
32 minx = abs[1];
33 maxx = abs[2];
34 ioctl(inFile,EVIOCGABS(ABS_Y),abs);
35 miny = abs[1];
36 maxy = abs[2];
37 ioctl(inFile,EVIOCGABS(ABS_PRESSURE),abs);
38 minp = abs[1];
39 maxp = abs[2];
40
41
42 close(inFile);
26 } 43 }
27 vendor = -1; 44 vendor = -1;
28 product = -1; 45 product = -1;
29 event = -1; 46 event = -1;
30 } 47 }