https://stackoverflow.com/questions/20014390/intercept-all-mouse-events
var eventCount = 0;
var eventProperty = [];
var TrackMouse = function (mouseEvent) {
eventProperty[eventCount++] = {
id: mouseEvent.toElement.id,
type: 'mouse',
ts: Date.now(),
x: mouseEvent.x,
y: mouseEvent.y,
};
console.log(
'Element id: ' +
eventProperty[eventCount - 1].id +
', X: ' +
mouseEvent.x +
', Y: ' +
mouseEvent.y +
'\n'
);
};
document.addEventListener('click', TrackMouse);