comparison src/video/x11/SDL_x11events.c @ 4644:fb500b3e1717

Added pressure support for touch events.
author Jim Grandpre <jim.tla@gmail.com>
date Sat, 29 May 2010 02:09:16 -0400
parents 8806b78988f7
children 0375d020e7e3
comparison
equal deleted inserted replaced
4643:8806b78988f7 4644:fb500b3e1717
446 if(rd >= size) { 446 if(rd >= size) {
447 for (i = 0; i < rd / sizeof(struct input_event); i++) { 447 for (i = 0; i < rd / sizeof(struct input_event); i++) {
448 switch (ev[i].type) { 448 switch (ev[i].type) {
449 case EV_ABS: 449 case EV_ABS:
450 //printf("Got position x: %i!\n",data->x); 450 //printf("Got position x: %i!\n",data->x);
451 if(ev[i].code == ABS_X) 451 switch (ev[i].code) {
452 data->x = ev[i].value; 452 case ABS_X:
453 else if (ev[i].code == ABS_Y) 453 data->x = ev[i].value;
454 data->y = ev[i].value; 454 break;
455 else if (ev[i].code == ABS_MISC) { 455 case ABS_Y:
456 data->up = SDL_TRUE; 456 data->y = ev[i].value;
457 data->finger = ev[i].value; 457 break;
458 } 458 case ABS_PRESSURE:
459 data->pressure = ev[i].value;
460 break;
461 case ABS_MISC:
462 data->up = SDL_TRUE;
463 data->finger = ev[i].value;
464 break;
465 }
459 break; 466 break;
460 case EV_MSC: 467 case EV_MSC:
461 if(ev[i].code == MSC_SERIAL) 468 if(ev[i].code == MSC_SERIAL)
462 data->finger = ev[i].value; 469 data->finger = ev[i].value;
463 break; 470 break;