decentraland / creator-hub

MIT License
0 stars 4 forks source link

[BUG] Missing keypress events in `PointerEventsResult` reports #183

Open ProteanCoding opened 4 months ago

ProteanCoding commented 4 months ago

Steps To Reproduce:

Press a few times the keys for moving the Avatar around, with the mouse pointer locked, and while running the following code:

import { engine, PointerEventsResult } from '@dcl/sdk/ecs'

engine.addSystem(() =>
  [...[...engine.getEntitiesWith(PointerEventsResult)][0]?.[1] || []]
    .forEach(result => console.log(JSON.stringify(result)))
)

Expected:

A log trace of up to 100 of the latest keys pressed and/or unpressed.

Actual:

Various key changes are missing in the list.

Notes:

The entries are such as this one: { "button": 6, "state": 1, "timestamp": 1097, "tickNumber": 250 }, with only every one entry per timestamp number. Clearly the timestamps are not fine-grained enough (perhaps due to them being improperly scaled when relayed from the engine), and thus preceding entries are being over-written by subsequent ones (or preventing them from being entered).

ProteanCoding commented 4 months ago

Most likely the cause of decentraland/sdk#439, decentraland/sdk#1027, and decentraland/sdk#1049.