decentraland / sdk

PM repository for SDK
Apache License 2.0
4 stars 4 forks source link

[BUG] Some Input Events [Key Presses] not registered #1027

Open ryan-wildy opened 7 months ago

ryan-wildy commented 7 months ago

Issue Description:

In SDK7 (sometimes in SDK6 too afair), sometimes the PET_UP/PET_DOWN event for button presses is not recorded, giving a false value in the isButtonPressed(..) function as well.

Pretty simple to reproduce, just log the value in a system. Most common when multiple keys are pressed/released in quick succession (like : press and hold W, and then press D and release both).

SDK:

Tool:

CLI Version:
Node Version:

Steps to reproduce:

export function worldmovesystem(dt: number) {

        let fordown = inputSystem.getInputCommand(InputAction.IA_ANY,PointerEventType.PET_DOWN)
        if(fordown)
        console.log(fordown)
        fordown = inputSystem.getInputCommand(InputAction.IA_ANY,PointerEventType.PET_UP)
        if(fordown)
        console.log(fordown)

}

Expected behaviour:

Expect PET_DOWN and PET_UP values for each key press/release.

Current behaviour:

Most common when multiple keys are pressed/released in quick succession (like : press and hold W, and then press D and release both), PET_UP event is not recorded for one of the keys.

Reproduction rate:

70-80%

Code Snippets:

export function worldmovesystem(dt: number) {

        let fordown = inputSystem.getInputCommand(InputAction.IA_ANY,PointerEventType.PET_DOWN)
        if(fordown)
        console.log(fordown)
        fordown = inputSystem.getInputCommand(InputAction.IA_ANY,PointerEventType.PET_UP)
        if(fordown)
        console.log(fordown)

} system.addEngine(worldmovesystem)

Platforms:

Browser:

Environment:

Evidence:

Additional Notes:

ProteanCoding commented 1 month ago

Caused by #1120 ?