Skip to content

Virtual gamepad keys get stuck #2

@parasyte

Description

@parasyte

When I press "up" on the virtual dpad, then slide my finger toward the top of the screen, the "up" button gets stuck in an "always on" state. The only way to release it is by reloading the game.

Discovered the reason for this just tonight; The virtual gamepad listens for pointer events on only a small part of the viewport. The initial touchstart/PointerDown event will be fired when my finger first touches the button. Then as I slide my finger, a series of touchmove/PointerMove events will fire. Eventually, my finger will leave the rectangle that the virtual gamepad is registered to. The following events will not be dispatched to the virtual gamepad, because they are outside of the listening rect.

And if the touchend/PointerUp event is fired while outside of that rect, this missed event means the virtual gamepad button will never be released!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions