mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-18 07:41:45 +00:00
Add a windowID field to SDL_TouchFingerEvent (bug #4331).
This is unimplemented on some platforms and will cause compile errors when building those platform backends for now.
This commit is contained in:
@@ -455,16 +455,16 @@ Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent *touchEvent, vo
|
||||
y = touchEvent->touches[i].targetY / client_h;
|
||||
|
||||
if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART) {
|
||||
SDL_SendTouch(deviceId, id, SDL_TRUE, x, y, 1.0f);
|
||||
SDL_SendTouch(deviceId, id, window_data->window, SDL_TRUE, x, y, 1.0f);
|
||||
|
||||
/* disable browser scrolling/pinch-to-zoom if app handles touch events */
|
||||
if (!preventDefault && SDL_GetEventState(SDL_FINGERDOWN) == SDL_ENABLE) {
|
||||
preventDefault = 1;
|
||||
}
|
||||
} else if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE) {
|
||||
SDL_SendTouchMotion(deviceId, id, x, y, 1.0f);
|
||||
SDL_SendTouchMotion(deviceId, id, window_data->window, x, y, 1.0f);
|
||||
} else {
|
||||
SDL_SendTouch(deviceId, id, SDL_FALSE, x, y, 1.0f);
|
||||
SDL_SendTouch(deviceId, id, window_data->window, SDL_FALSE, x, y, 1.0f);
|
||||
|
||||
/* block browser's simulated mousedown/mouseup on touchscreen devices */
|
||||
preventDefault = 1;
|
||||
|
Reference in New Issue
Block a user