Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

joystick:isGamepadDown() only returns true for one frame #11

Open
ArsonousKnight52 opened this issue Dec 15, 2024 · 1 comment
Open

Comments

@ArsonousKnight52
Copy link

the joystick:isGamepadDown() function only returns true for a singular frame instead of returning true for the duration that the button is held down, like 3.0 or regular love2d.

code to reproduce:

holding = false

function love.load()

    joystick = love.joystick.getJoysticks()[1]

end

function love.update()

    if joystick:isGamepadDown("a") then
        holding = true
    else
        holding = false
    end
end

function love.draw(screen)

    love.graphics.print(tostring(holding))

end
@ArsonousKnight52
Copy link
Author

this also extends to joystick:isDown()

code to reproduce

holding = false

function love.load()

    joystick = love.joystick.getJoysticks()[1]

end

function love.update()

    if joystick:isDown(1) then
        holding = true
    else
        holding = false
    end
end

function love.draw(screen)

    love.graphics.print(tostring(holding))

end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant