Open davidhesselbom opened 6 months ago
Touch is problematic. Chrome fix and break it on every version, If you google it you will see that it's a problem for over a decade now. What the device emulator does on the desktop is completely irrelevant.
If i remember correctly the mobile version of firefox worked as expected.
If it's not too late to give a response, but I recently figured out adding the event listener to the document object, i.e. winder.document.addEventListener(...)
worked for me.
Interesting.
Did you modify events in the 'Window.8.0.0.js' ?
https://github.com/nkast/Wasm/blob/main/Wasm.Dom/wwwroot/js/Window.8.0.0.js#L73-L106
I'm trying to get gestures working, i.e. dragging with a finger a smartphone screen.
Using the default template, the game ends up with a file named
Window.6.0.2.js
that defines a bunch of window events, and using the browser's debugger and "device emulation" mode, I can see the eventswindow.onmousedown
andwindow.onmouseup
are firing. However,window.ontouchstart
never fires...So, I added this in
index.html
:and then I get the expected output in the console when clicking around in "device emulation" mode, but
window.ontouchstart
still isn't firing.Also, I added this to the
Update
method of the game:and when using the browser's "device emulation" mode, the button is always "Released", never "Pressed", despite the fact that, as mentioned earlier, the events
window.onmousedown
andwindow.onmouseup
inWindow.6.0.2.js
are both firing.Maybe I'm missing something obvious?