fix touch event
This commit is contained in:
parent
fdb357f02f
commit
10dda34d4d
|
|
@ -76,12 +76,10 @@ void mainloop() {
|
||||||
mouse_data.x = (int)x;
|
mouse_data.x = (int)x;
|
||||||
mouse_data.y = (int)y;
|
mouse_data.y = (int)y;
|
||||||
|
|
||||||
if (event.tfinger.fingerId == 0) {
|
if (event.type == SDL_FINGERDOWN || event.type == SDL_FINGERMOTION) {
|
||||||
if (event.type == SDL_FINGERDOWN || event.type == SDL_FINGERMOTION) {
|
mouse_data.btn1 = 1;
|
||||||
mouse_data.btn1 = 1;
|
} else if (event.type == SDL_FINGERUP) {
|
||||||
} else if (event.type == SDL_FINGERUP) {
|
mouse_data.btn1 = 0;
|
||||||
mouse_data.btn1 = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue