mirror of
https://github.com/yawut/SDL.git
synced 2026-09-01 21:55:07 -05:00
Added pressure support for touch events.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user