mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-23 22:15:05 +00:00
Fix touch holding detection after #5244 changes
This commit is contained in:
parent
df0d696a62
commit
ecd922b5cf
|
@ -108,17 +108,30 @@ VITA_PollTouch(void)
|
||||||
float x = 0;
|
float x = 0;
|
||||||
float y = 0;
|
float y = 0;
|
||||||
float force = (touch[port].report[i].force - force_info[port].min) / force_info[port].range;
|
float force = (touch[port].report[i].force - force_info[port].min) / force_info[port].range;
|
||||||
|
int finger_down = 0;
|
||||||
|
|
||||||
|
if (touch_old[port].reportNum > 0) {
|
||||||
|
for (int j = 0; j < touch_old[port].reportNum; j++) {
|
||||||
|
if (touch[port].report[i].id == touch_old[port].report[j].id ) {
|
||||||
|
finger_down = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VITA_ConvertTouchXYToSDLXY(&x, &y, touch[port].report[i].x, touch[port].report[i].y, port);
|
VITA_ConvertTouchXYToSDLXY(&x, &y, touch[port].report[i].x, touch[port].report[i].y, port);
|
||||||
finger_id = (SDL_FingerID) touch[port].report[i].id;
|
finger_id = (SDL_FingerID) touch[port].report[i].id;
|
||||||
|
|
||||||
// Send an initial touch
|
// Skip if finger was already previously down
|
||||||
SDL_SendTouch((SDL_TouchID)port,
|
if(!finger_down) {
|
||||||
finger_id,
|
// Send an initial touch
|
||||||
Vita_Window,
|
SDL_SendTouch((SDL_TouchID)port,
|
||||||
SDL_TRUE,
|
finger_id,
|
||||||
x,
|
Vita_Window,
|
||||||
y,
|
SDL_TRUE,
|
||||||
force);
|
x,
|
||||||
|
y,
|
||||||
|
force);
|
||||||
|
}
|
||||||
|
|
||||||
// Always send the motion
|
// Always send the motion
|
||||||
SDL_SendTouchMotion((SDL_TouchID)port,
|
SDL_SendTouchMotion((SDL_TouchID)port,
|
||||||
|
|
Loading…
Reference in a new issue