Added pressure support for touch events.

This commit is contained in:
Jim Grandpre
2010-05-29 02:09:16 -04:00
parent cd768e2013
commit 80ecbb9011
6 changed files with 38 additions and 18 deletions

View File

@@ -424,6 +424,7 @@ SDL_SendTouchMotion(int id, int fingerid, int relative,
event.tfinger.fingerId = (Uint8) fingerid;
event.tfinger.x = x;
event.tfinger.y = y;
event.tfinger.pressure = pressure;
event.tfinger.state = touch->buttonstate;
event.tfinger.windowID = touch->focus ? touch->focus->id : 0;
posted = (SDL_PushEvent(&event) > 0);

View File

@@ -448,14 +448,21 @@ X11_PumpEvents(_THIS)
switch (ev[i].type) {
case EV_ABS:
//printf("Got position x: %i!\n",data->x);
if(ev[i].code == ABS_X)
data->x = ev[i].value;
else if (ev[i].code == ABS_Y)
data->y = ev[i].value;
else if (ev[i].code == ABS_MISC) {
data->up = SDL_TRUE;
data->finger = ev[i].value;
}
switch (ev[i].code) {
case ABS_X:
data->x = ev[i].value;
break;
case ABS_Y:
data->y = ev[i].value;
break;
case ABS_PRESSURE:
data->pressure = ev[i].value;
break;
case ABS_MISC:
data->up = SDL_TRUE;
data->finger = ev[i].value;
break;
}
break;
case EV_MSC:
if(ev[i].code == MSC_SERIAL)