8

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
SimplGy
  • 20,079
  • 15
  • 107
  • 144
  • This is a good alternative, but doesn't work as well for emulating 'touchmove' during development: http://stackoverflow.com/questions/9389968/jquery-touchstart-in-browser – SimplGy Mar 26 '12 at 18:37
  • 1
    Answered over here: http://stackoverflow.com/a/10150177/89484 You can enable touch event emulation in Chrome DevTools now. – Paul Irish Apr 19 '12 at 23:03
  • 2
    Select **Emulate touch events** in the Dev Tools Settings panel. (To get at Settings, click the gear/cog icon at the bottom right of the tools.) You can then emulate touch events with your mouse, and set break points (in the Scripts panel) for touch event listener functions – Sam Dutton May 15 '12 at 19:25
  • 1
    Not only is there no "gear" icon in Chrome anymore, but setting "enable touch emulation" does absolutely nothing for me, dev tools open or closed. What happened!? Why has this feature been removed!? So frustrating. – Sean Kendle Sep 04 '13 at 19:18

1 Answers1

2

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');
}

})();
SimplGy
  • 20,079
  • 15
  • 107
  • 144