In order to develop and debug mobile and tablet applications, I'd like to be able to have my mouse emulate touchstart
, touchmove
, and touchen
d.
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?
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.
The touchstart event occurs when the user touches an element. Note: The touchstart event will only work on devices with a touch screen.
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.
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.
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');
}
})();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With