Skip to content

buttonDown, buttonUp are called every frame, even when no buttons are being pressed #51

@bartek1009x

Description

@bartek1009x

I'm testing my game with a Nintendo Switch Pro controller on Windows. The controller works perfectly fine.

I have a class that implements ControllerListener, and of course in the main class I add the listener through Controllers.addListener();.

In this function:

    @Override
    public boolean buttonDown(Controller controller, int i) {
        System.out.println("Button down: " + controller.getButton(i));

        if (i == controller.getMapping().buttonA) {
            processEnter();
        }

        return true;
    }

"Button down: true" is printed and the processEnter function gets called every frame, despite none of the buttons being pressed. I checked the buttonUp function and it acted the same way.

However, I tried downgrading the gdx-controllers version a few times, and it seems that this is a problem in 2.2.4, 2.2.3, and 2.2.2. In version 2.2.1, everything works properly and the buttonDown and buttonUp functions are called when I actually press a button, so this bug must have been introduced in 2.2.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions