1
0
Fork 0

fix touch event

This commit is contained in:
zongor 2026-02-13 22:30:51 -08:00
parent fdb357f02f
commit 10dda34d4d
1 changed files with 4 additions and 6 deletions

View File

@ -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;
} }