getDebounced

open fun getDebounced(@NonNull button: Controls): Boolean

Check if a button is currently pressed on a gamepad, with debounce to ignore a press that was already detected upon the first call of this function and button. This is an implementation of rising edge detection, but also applies a check for the initial state of the button, making it useful for task toggles.

See the Condition class for more boolean state management.

Return

True if the button is pressed and not debounced by the definition of this method

Parameters

button

The button to check