is there way broadcast mouse events such mousedown, mouseup , mousemove nodes connected nodejs server? trying replicated events @ (x,y) coordinates. there way can achieved?
yes is
client
window.addeventlistener('mousedown', function(event) { var data = extractmousedata(event); //extract data event. io.emit('mousedown', data); }); io.on('mousedown', function(data) { processmouseevent(data); });
server
io.on('connection', function (socket) { socket.on('mousedown', function (data) { socket.broadcast.emit('mousedown', data); }); });
just implement extractmousedata
, processmouseevent
functions , make them want , here go.