pub unsafe extern "C" fn controller_get_digital(
    id: controller_id_e_t,
    button: controller_digital_e_t
) -> i32
Expand description

Checks if a digital channel (button) on the controller is currently pressed.

This function uses the following values of errno when an error state is reached: EINVAL - A value other than E_CONTROLLER_MASTER or E_CONTROLLER_PARTNER is given. EACCES - Another resource is currently trying to access the controller port.

\param id The ID of the controller (e.g. the master or partner controller). Must be one of CONTROLLER_MASTER or CONTROLLER_PARTNER \param button The button to read. Must be one of DIGITAL_{RIGHT,DOWN,LEFT,UP,A,B,Y,X,R1,R2,L1,L2}

\return 1 if the button on the controller is pressed. If the controller was not connected, then 0 is returned