src/video/x11/SDL_x11touch.c
changeset 5967 ae97a61f002f
parent 5966 2edecf22a2e7
child 5968 b229328c7ad4
equal deleted inserted replaced
5966:2edecf22a2e7 5967:ae97a61f002f
    49     if(line[0] == '\n') {
    49     if(line[0] == '\n') {
    50       if(vendor == 1386 || vendor==1) {
    50       if(vendor == 1386 || vendor==1) {
    51 
    51 
    52         sprintf(tstr,"/dev/input/event%i",event);
    52         sprintf(tstr,"/dev/input/event%i",event);
    53 
    53 
       
    54         int tsfd = open( tstr, O_RDONLY | O_NONBLOCK );
       
    55         if ( tsfd == -1 )
       
    56             continue;   /* Maybe not enough permissions ? */
       
    57 
    54         SDL_Touch touch;
    58         SDL_Touch touch;
    55         touch.pressure_max = 0;
    59         touch.pressure_max = 0;
    56         touch.pressure_min = 0;
    60         touch.pressure_min = 0;
    57         touch.id = event; 
    61         touch.id = event; 
    58 
    62 
    64         data->pressure = -1;
    68         data->pressure = -1;
    65         data->finger = 0;
    69         data->finger = 0;
    66         data->up = SDL_FALSE;
    70         data->up = SDL_FALSE;
    67         data->down = SDL_FALSE;
    71         data->down = SDL_FALSE;
    68 
    72 
    69         data->eventStream = open(tstr, 
    73         data->eventStream = tsfd;
    70                     O_RDONLY | O_NONBLOCK);
       
    71         ioctl (data->eventStream, EVIOCGNAME (sizeof (tstr)), tstr);
    74         ioctl (data->eventStream, EVIOCGNAME (sizeof (tstr)), tstr);
    72 
    75 
    73         int abs[5];
    76         int abs[5];
    74         ioctl(data->eventStream,EVIOCGABS(0),abs);	
    77         ioctl(data->eventStream,EVIOCGABS(0),abs);	
    75         touch.x_min = abs[1];
    78         touch.x_min = abs[1];