diff --git a/client/index.js b/client/index.js index c28d98d..cca9c0d 100644 --- a/client/index.js +++ b/client/index.js @@ -169,9 +169,8 @@ throughputTicker.on('tick', () => { Decoder.throughput = 0; Encoder.throughput = 0; }); -// Input messages. -const messageHandle = setInterval(() => { - // Mouse/touch movement. +// Mouse/touch movement. +const pointerMovementHandle = setInterval(() => { do { if (isPointingAtAnything()) { const normal = createMoveToNormal(pointingAt); @@ -182,6 +181,9 @@ const messageHandle = setInterval(() => { } actionRegistry.state = actionRegistry.state.delete('MoveTo'); } while (false); +}, 1000 / 15); +// Input messages. +const inputHandle = setInterval(() => { if (actionState !== actionRegistry.state) { actionState = actionRegistry.state; socket.send(new InputPacket(JSON.stringify(actionRegistry.state.toJS())));