refactor: decouple pointer events
This commit is contained in:
parent
255f92760d
commit
b3dfd7cf2d
|
@ -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())));
|
||||
|
|
Loading…
Reference in New Issue
Block a user