Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch Events #226

Closed
mstang opened this issue Dec 30, 2017 · 2 comments
Closed

Touch Events #226

mstang opened this issue Dec 30, 2017 · 2 comments

Comments

@mstang
Copy link

mstang commented Dec 30, 2017

Hi,
I have been drawing on a canvas (clojurescript) and using a mouse to detect events.
How do I use Touch Events on Phones?

thanks,

Mark

@nbeloglazov
Copy link
Member

Hi Mark. mouse-clicked, mouse-pressed, mouse-moved should work both on PC and phones. Here is example sketch that prints all handler events: http://quil.info/sketches/show/-L1oPMeKB76WmvqUZUTn When I open it on phone and click on sketch I see mouse-clicked events logged.

Do you have a particular issue with mouse (touches) not working in quil?

@mstang
Copy link
Author

mstang commented Jan 2, 2018

Hi Nikita,
I looked through the ClojureScript code and didn't see anything referring to "touch". And I couldn't figure out how to show a console on my phone. And the defsketch only shows mouse functions. So, I was very confused, which is why I posted the issue and the message. I am getting an error message about "missing event handlers" in processing.js. When I looked at the line that is generating the error I noticed it is in a function designed to handle the "touch" events. I see there where it maps the touch events to mouse handlers. So, I updated one of my mouse handlers to draw some text when clicked. And when I tap on my phone it appears. So, I think everything is good.
Thanks for the quick reply.

@mstang mstang closed this as completed Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants