decentraland / decentraland/creator-hub

[BUG] Missing keypress events in `PointerEventsResult` reports

Open
#183 1 comment 0 reactions 0 assignees View on GitHub
bug requires validation
Dominant language
TypeScript
Stars
7
Forks
14
Avg merge
2d 8h
Merged PRs (30d)
44

Description

### **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).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.