Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an add-on or extension to emulate touch events? [closed]

In order to develop and debug mobile and tablet applications, I'd like to be able to have my mouse emulate touchstart, touchmove, and touchend.

I have found two possibilities:

Phantom Limb http://www.vodori.com/blog/phantom-limb.html (doesn't seem to work)

ChromeTouch https://chrome.google.com/webstore/detail/ncegfehgjifmmpnjaihnjpbpddjjebme (Scrolls the page, but doesn't fire touch events)

Does anyone know of an addon that will fire touch events in a desktop webkit browser?

like image 518
SimplGy Avatar asked Mar 26 '12 15:03

SimplGy


People also ask

How do you simulate touch events?

Activate the Developer Tools with CMD+ALT+i (OSX) or F12 (Windows). Click the cog icon to open up it's settings. Then switch to the Overrides tab. Make sure Enable is checked and then activate Emulate touch events.

Does Touchstart work on desktop?

The touchstart event occurs when the user touches an element. Note: The touchstart event will only work on devices with a touch screen.

Does Safari support touch events?

Safari mobile doesn't support touch events. We have tried to fix it with mouse events as it was written in the apple documentation but had no success.

Can I use touch events?

Touch events are supported by Chrome and Firefox on desktop, and by Safari on iOS and Chrome and the Android browser on Android, as well as other mobile browsers like the Blackberry browser.


1 Answers

The only thing I found to execute touchmove was to do something manually coded like this:

(function(){

var isDown = false
,   dragging
;

$('body').bind('mousedown', function(){ isDown = true; });
$('body').bind('mousemove', function(){ if(isDown) { dragging(); } });    
$('body').bind('touchmove', function(){ dragging(); });
$('body').bind('mouseup', function(){ isDown = false; });

dragging = function () {
    console.log('content being drug');
}

})();
like image 67
SimplGy Avatar answered Oct 04 '22 18:10

SimplGy