Skip to content

Commit 70d9c2e

Browse files
committed
Revert "[Web] Disregard touch events in pointer callbacks"
This reverts commit e7e5c2b.
1 parent 73da0d2 commit 70d9c2e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

platform/web/js/libs/library_godot_input.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,6 @@ const GodotInput = {
504504
const func = GodotRuntime.get_func(callback);
505505
const canvas = GodotConfig.canvas;
506506
function move_cb(evt) {
507-
if (evt.pointerType == 'touch') {
508-
return;
509-
}
510-
511507
const rect = canvas.getBoundingClientRect();
512508
const pos = GodotInput.computePosition(evt, rect);
513509
// Scale movement
@@ -539,10 +535,6 @@ const GodotInput = {
539535
const func = GodotRuntime.get_func(callback);
540536
const canvas = GodotConfig.canvas;
541537
function button_cb(p_pressed, evt) {
542-
if (evt.pointerType == 'touch') {
543-
return;
544-
}
545-
546538
const rect = canvas.getBoundingClientRect();
547539
const pos = GodotInput.computePosition(evt, rect);
548540
const modifiers = GodotInput.getModifiers(evt);
@@ -555,8 +547,8 @@ const GodotInput = {
555547
evt.preventDefault();
556548
}
557549
}
558-
GodotEventListeners.add(canvas, 'pointerdown', button_cb.bind(null, 1), false);
559-
GodotEventListeners.add(window, 'pointerup', button_cb.bind(null, 0), false);
550+
GodotEventListeners.add(canvas, 'mousedown', button_cb.bind(null, 1), false);
551+
GodotEventListeners.add(window, 'mouseup', button_cb.bind(null, 0), false);
560552
},
561553

562554
/*

0 commit comments

Comments
 (0)