Use pointer events instead of touch events in TouchControl

This commit is contained in:
Wlowscha 2025-09-07 16:27:26 +02:00 committed by Sirz Benjie
parent 7001f78beb
commit 3070cb1ee7
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -61,12 +61,12 @@ export class TouchControl {
* event, removes the keydown state, and removes the 'active' class from the node and the last touched element.
*/
bindKey(node: HTMLElement, key: string) {
node.addEventListener("touchstart", event => {
node.addEventListener("pointerdown", event => {
event.preventDefault();
this.touchButtonDown(node, key);
});
node.addEventListener("touchend", event => {
node.addEventListener("pointerup", event => {
event.preventDefault();
this.touchButtonUp(node, key, event.target?.["id"]);
});