Fred Ross-perry
Fred Ross-perry

Reputation: 71

emulating touch events for Chrome - is there a better way?

I'm using Chrome with source maps for debugging a GWT-based app. It's very nice. What I want to do now is have Chrome pretend to be a mobile device. I turned on "emulate touch events", but it seems that the mouse events are still being generated as well. What I was hoping for would be that the browser would act more or less exactly like a mobile browser. I can run my code in XCode's iOS simulator, but can't debug it easily. Thoughts? Thanks.

Upvotes: 1

Views: 1005

Answers (1)

Colin Alworth
Colin Alworth

Reputation: 18331

Are you sure that a real touch device doesn't also send mouse events when a touch occurs?

If you test this, I'm certain you'll find that a real touch device actually generates some mouse events when a tap or touch start/move/end occurs. Take a look at https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Events/Touch_events to see how to avoid generating mouse events, at least on real touch devices... it may not work in chrome, but you have to at least start there.

Upvotes: 2

Related Questions