Is there a JustDown function for gamepad?

Hi There,

I’m fairly new and not experienced enough to write a custom event that would listen for this kind of input – but I was wondering if there was a function for gamepad that is similar to Phaser.Input.Keyboard.JustDown() – because the basic gamepad.BUTTON (i.e. - gamepad.a) functions like an isDown command.

I would like a single read button press for gamepad input

If not possible, could I get tips on how to create an event listener to function the same way?

Thank you kindly.

1 Like

I haven’t used the gamepad before, but I can’t find a method like you’re asking for in the docs: https://photonstorm.github.io/phaser3-docs/Phaser.Input.Gamepad.Button.html

Closest I see is for checking if a button is currently down.https://photonstorm.github.io/phaser3-docs/Phaser.Input.Gamepad.Gamepad.html#isButtonDown__anchor or https://photonstorm.github.io/phaser3-docs/Phaser.Input.Gamepad.Button.html#pressed__anchor

I see, thank you for the reply.

Since the input was based on an animation, in cases where I didn’t want them to spam a button and have the first frame play said amount of times… I just created an animation complete flag.