HotStudio/touchy

sending 'touchy-drag' Events to PHP

lx2 opened this issue · 1 comments

lx2 commented

Hello,

I want to log all touch-events of an user ( not only events of an specific target div).
Especially the 'touchy-drag' - Events should be logged into a file, with something like that:

function sendEventToPhp(e){
    $.post( "dump_events.php", 
    { 
        type        : "END",
        fingerID    : "0",
        x           : "345",
        y           : "678"
    } );
}

var handleTouchyDrag = function (e) {
    sendEventToPhp(e);
};
$('body').bind('touchy-drag', handleTouchyDrag);

/*
document.addEventListener('touchy-drag', function(e) {
    sendEventToPhp(e);
});
*/
  1. Due to the preventDefault, scrolling and zooming isn't working after binding to body and the document.addEventListener doesn't work.
    How can I modify that.
  2. what would be the right attributes from a touchy-drag event "e" to send. something like that ? :
    e.type
    e.id
    e.x
    e.y