+ 1

touch events in javascript

how can i know that user Is touching screen in javascript? i want to move the player when user touch it. https://code.sololearn.com/WHJ6YmVAzpVQ/?ref=app

19th Dec 2021, 7:02 AM
Vishal
Vishal - avatar
2 Answers
+ 2
You want to know that a user is touching the screen, but you don't want to know when he is touching the screen? Schrödinger's touch event? Anyways: here is an example for touch events: https://code.sololearn.com/W5U4jgWtQNoT/?ref=app
19th Dec 2021, 12:17 PM
Alex
Alex - avatar
+ 3
If you don't want that anything happens when the user touches the screen, than don't track the touch events. On touch screens you can't prevent that the users touch their own screen... Can you please give an example what exactly you would like to do? Alex "Schrödinger's touch event" – that sounds like a semester party at the faculty of mathematics and natural sciences. :)
19th Dec 2021, 12:35 PM
Lisa
Lisa - avatar