Engine-side bug: Input.Mouse.buttonUp set while Input.Mouse.buttons is not

● ARCHIVED · READ-ONLY
Started by Yare 3 posts View original ↗
  1. Reposting this from the Steam discussion boards for visibility.

    There's a bug in VNM's engine-side input handling code that occasionally causes clicks to get lost. In Component_InputHandler.update:

    Code:
    //...
    if Input.Mouse.buttonUp
        console.log("click")       
        gs.GlobalEventManager.emit("mouseUp")
    //...

    This works as expected. Every left-click gets logged to the console. However, if you also log the button status...

    Code:
    //...
    if Input.Mouse.buttonUp
        console.log("click")     
        console.log(Input.Mouse.buttons) 
        gs.GlobalEventManager.emit("mouseUp")
    //...

    You'll see that something is broken engine-side. Click repeatedly and most of your logs will correctly show [0,2,0,0] in the console. But occasionally you'll see [0,0,0,0] reported even though Input.Mouse.buttonUp was true on the previous line. This causes issues in numerous systems such as hotspots and choice buttons, where the code listening for the "mouseUp" event gets triggered, but when the code checks against Input.Mouse.buttons[Input.Mouse.BUTTON_LEFT] to make sure the correct button was generating the mouseUp, it fails.
  2. Hello Yare, thanks for reporting. I will take a look into that soon and let you know if that is an actual bug or by purpose.
  3. Thank you for looking into this.