lichen-community-systems / Flocking

Flocking - Creative audio synthesis for the Web
GNU General Public License v2.0
697 stars 60 forks source link

Touch events on mobile browser #281

Open codelikeanartist opened 5 years ago

codelikeanartist commented 5 years ago

I don't seem to get user input on mobile devices with the playground examples. I tried to add a plain HammerJs instance to capture touch events but no success. Touch callbacks are not triggered. Maybe interferes with JQuery. Any ideas on this?

colinbdclark commented 5 years ago

Hi @codelikeanartist, sorry to hear it's not working for you. Do you have some sample code I can try?

codelikeanartist commented 5 years ago

Finally found a way to get it working. Need to add an event handler on touchmove, then convert the touch move into a mouse move, with a preceeding mouseover. Modified FM example attached flock-fm.html.zip

codelikeanartist commented 5 years ago

maybe one could just add the touch event handlers to the browser UGEN?

colinbdclark commented 5 years ago

I think you're right—there's no reason we shouldn't have support for touchdown and touch move events in the relevant unit generators... or perhaps ones that are appropriately renamed. It's something I can try to take a look at when I've got some spare time. Thanks for the report, @codelikeanartist.