Ignore non-primary touch events.

This commit is contained in:
Philip Rideout
2018-09-11 13:23:50 -07:00
parent 750b15830f
commit f84d74378f

View File

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