finite_gamepad_key_valid
The finite_gamepad_key_valid function checks if a FiniteGamepadKey is valid
bool finite_gamepad_key_valid(FiniteGamepadKey key)Parameters
Section titled “Parameters”| Type | Description |
|---|---|
FiniteGamepadKey key | The FiniteGamepadKey to check the state of |
Code Example
Section titled “Code Example”bool withGP = finite_gamepad_init(myShell);myShell->canHomeMenu = false;
if (!withGP) { FINITE_LOG_ERROR("Can't poll controller data");}
if (finite_gamepad_key_valid(FINITE_BTN_A)) { FINITE_LOG("A btn is valid");}Specification
Section titled “Specification”Developers should ALWAYS call finite_gamepad_key_valid to verify a FiniteGamepadKey’s existence in the internal finite_gamepad_key_lookup table. Just because an enum exists does not mean that the evdev code for that input option is present.
As of v0.7.0, the finite controller hasnt been finished. As such theres been no testing for modular controllers. It’s expected that buttons should work as written, however.