Touch screen js

Hi, is there a js script that handles default touch events? For example

One finger move
Two-fingered zoom
Two-fingered rotate

I have the basic script working:

It would be cool to have a default script for all standard touch actions.


There are a number of standard JS libraries that you can use for this. hammer.js was one that has been used in the past:

1 Like

Ended up using the code from this:

That script doesn’t do 2 finger rotate though

You are correct. However I found hammerjs difficult to implement and the play canvas script was very close to what I was after and very easy to implement.

If you are still interested in hammer.js, you can look at the old model viewer starter kit which used it:

1 Like