decentraland / sdk

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

[BUG] inputSystem.isPressed gets stuck in true #1049

Open ai47patos opened 9 months ago

ai47patos commented 9 months ago

Issue Description:

When you press simultaneously two different input keys, one of them gets stuck as pressed inputSystem.isPressed true

SDK:

Tool:

CLI Version: 3.18.0 Node Version: 18.16.0 "@dcl/js-runtime": "7.3.29" "@dcl/sdk": "^7.3.18"

Steps to reproduce:

  1. Code:
    import { engine, inputSystem } from "@dcl/sdk/ecs";
    function controllerSystem(){
    console.log(inputSystem.isPressed(InputAction.IA_PRIMARY) || inputSystem.isPressed(InputAction.IA_SECONDARY))
    }
    engine.addSystem(controllerSystem)
  2. Press simultaneously the two inputs, you may need 2-3 tries to get it right
  3. One of them will still be true in the logs even after you have no inputs pressed

Expected behaviour:

inputSystem.isPressed should return false

Current behaviour:

inputSystem.isPressed is stuck returning true, event if you have no inputs pressed

Reproduction rate:

You have to time correctly pressing the inputs, isn't too difficult, I manage to get the bug in 1-3 attempts

Code Snippets:

function controllerSystem(){
    console.log(inputSystem.isPressed(InputAction.IA_PRIMARY) || inputSystem.isPressed(InputAction.IA_SECONDARY))
}
engine.addSystem(controllerSystem)

Platforms:

Browser:

Environment:

Evidence:

Additional Notes:

ProteanCoding commented 3 months ago

Caused by #1120 ?