From f84d74378fe28883bd22c250caaf99c2e36efa48 Mon Sep 17 00:00:00 2001 From: Philip Rideout Date: Tue, 11 Sep 2018 13:23:50 -0700 Subject: [PATCH] Ignore non-primary touch events. --- samples/web/filaweb.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/web/filaweb.js b/samples/web/filaweb.js index 9f3631bea3..45b9538d52 100644 --- a/samples/web/filaweb.js +++ b/samples/web/filaweb.js @@ -48,6 +48,9 @@ function maybe_launch() { // Update a tiny queue of pointer events. We don't send them to WASM immediately because ImGui // detects click events by looking for three consecutive frames of down-up-down. function canvas_mouse(evt) { + if (evt.pointerType == 'touch' && !evt.isPrimary) { + return; + } let args = [evt.clientX, evt.clientY, evt.deltaX || 0, evt.deltaY || 0, evt.buttons]; if (evt.buttons != previous_mouse_buttons || queued_mouse_events.length == 0) { queued_mouse_events.push(args);