lars Posted January 28, 2019 Share Posted January 28, 2019 Right now, when i want to "disable multitouch" I do the following: this.mouseCounter = 0: On a pointerDown event: this.mouseCounter++; if(this.mouseCounter < 2 ){ doSomeThing } On a pointerUp event: this.mouseCounter = 0; Simply q ? Is there a better way to do this. Quote Link to comment Share on other sites More sharing options...
Exca Posted January 28, 2019 Share Posted January 28, 2019 When a touch/pointer begins, store the pointerId of the first touch and keep track of that and only react to events with that id. When event ends, make it null and allow storing of next touch/point. Quote Link to comment Share on other sites More sharing options...
jonforum Posted January 28, 2019 Share Posted January 28, 2019 Am not sure but you can also try and experiment around preventDefault. document.addEventListener('eventType', e=> { ifConditions && e.preventDefault(); // prevent this eventType }); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.