Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11touch.c @ 5044:4913042e8572
Removed debug print statements
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 19 Jan 2011 19:51:04 -0800 |
parents | 1002d074d459 |
children | b530ef003506 |
comparison
equal
deleted
inserted
replaced
5043:da347bfed240 | 5044:4913042e8572 |
---|---|
32 | 32 |
33 void | 33 void |
34 X11_InitTouch(_THIS) | 34 X11_InitTouch(_THIS) |
35 { | 35 { |
36 #ifdef SDL_INPUT_LINUXEV | 36 #ifdef SDL_INPUT_LINUXEV |
37 printf("Initializing touch...\n"); | |
38 | |
39 FILE *fd; | 37 FILE *fd; |
40 fd = fopen("/proc/bus/input/devices","r"); | 38 fd = fopen("/proc/bus/input/devices","r"); |
41 | 39 |
42 char c; | 40 char c; |
43 int i = 0; | 41 int i = 0; |
44 char line[256]; | 42 char line[256]; |
45 char tstr[256]; | 43 char tstr[256]; |
46 int vendor = -1,product = -1,event = -1; | 44 int vendor = -1,product = -1,event = -1; |
47 while(!feof(fd)) { | 45 while(!feof(fd)) { |
48 if(fgets(line,256,fd) <=0) continue; | 46 if(fgets(line,256,fd) <=0) continue; |
49 //printf("%s",line); | |
50 if(line[0] == '\n') { | 47 if(line[0] == '\n') { |
51 if(vendor == 1386){ | 48 if(vendor == 1386){ |
52 printf("Wacom... Assuming it is a touch device\n"); | 49 /*printf("Wacom... Assuming it is a touch device\n");*/ |
53 sprintf(tstr,"/dev/input/event%i",event); | 50 /*sprintf(tstr,"/dev/input/event%i",event);*/ |
54 printf("At location: %s\n",tstr); | 51 /*printf("At location: %s\n",tstr);*/ |
55 | 52 |
56 SDL_Touch touch; | 53 SDL_Touch touch; |
57 touch.pressure_max = 0; | 54 touch.pressure_max = 0; |
58 touch.pressure_min = 0; | 55 touch.pressure_min = 0; |
59 touch.id = event; | 56 touch.id = event; |
67 data->pressure = -1; | 64 data->pressure = -1; |
68 data->finger = 0; | 65 data->finger = 0; |
69 data->up = SDL_FALSE; | 66 data->up = SDL_FALSE; |
70 | 67 |
71 | 68 |
72 printf("Opening device...\n"); | |
73 //printf("New Touch - DataPtr: %i\n",data); | |
74 data->eventStream = open(tstr, | 69 data->eventStream = open(tstr, |
75 O_RDONLY | O_NONBLOCK); | 70 O_RDONLY | O_NONBLOCK); |
76 ioctl (data->eventStream, EVIOCGNAME (sizeof (tstr)), tstr); | 71 ioctl (data->eventStream, EVIOCGNAME (sizeof (tstr)), tstr); |
77 printf ("Reading From : %s\n", tstr); | |
78 | |
79 | |
80 | 72 |
81 int abs[5]; | 73 int abs[5]; |
82 ioctl(data->eventStream,EVIOCGABS(0),abs); | 74 ioctl(data->eventStream,EVIOCGABS(0),abs); |
83 touch.x_min = abs[1]; | 75 touch.x_min = abs[1]; |
84 touch.x_max = abs[2]; | 76 touch.x_max = abs[2]; |