qwac-sys 0.28.1

The FFI crates for QWAC
Documentation
#[derive(Clone, Copy, Hash, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[repr(u8)]
pub enum GamepadButton {
    Up,
    Down,
    Left,
    Right,
    A,
    B,
    X,
    Y,
    Start,
    Select,
    LeftShoulder,
    RightShoulder,
    LeftTrigger,
    RightTrigger,
    LeftStick,
    RightStick,
}

#[derive(Clone, Copy, Hash, Debug, Eq, PartialEq, Ord, PartialOrd)]
#[repr(u8)]
pub enum GamepadAxis {
    LeftUp,
    LeftDown,
    LeftLeft,
    LeftRight,
    RightUp,
    RightDown,
    RightLeft,
    RightRight,
}

#[link(wasm_import_module = "qwac_input")]
extern "C" {
    /// Get the button press states for all 4 gamepads
    pub fn gamepad_buttons() -> i64;

    /// Get the axis state for one gamepad axis, range [-1, 1].
    pub fn gamepad_axis(player: i32, axis: i32) -> f32;
}