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);
});
*/
- 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. - 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
fisherwebdev commented
- There are preventDefault options for each phase: start, move, end. See the source:
https://github.com/HotStudio/touchy/blob/master/jquery.touchy.js#L56-L59
Also see the README for info about how to override default setttings:
https://github.com/HotStudio/touchy#overriding-default-configuration-settings - For the data, please see the appropriate sections of the README:
https://github.com/HotStudio/touchy#data-passed-to-event-handlers
https://github.com/HotStudio/touchy#touchy-drag
Also see the source:
https://github.com/HotStudio/touchy/blob/master/jquery.touchy.js#L145-L149
https://github.com/HotStudio/touchy/blob/master/jquery.touchy.js#L108-L111
etc.