Luna::HID::ControllerInputState

The fetched input state for one generic game controller.

struct Luna::HID::ControllerInputState

Member objects

  • bool connected

    Whether this device is connected and the state is valid.

  • ControllerButton buttons

    A combination of bits to represent the pressed state of each button (1 for pressed, 0 for not pressed).

  • f32 axis_lx

    The x axis for left pad, mapped to [-1, 1].

  • f32 axis_ly

    The y axis for left pad, mapped to [-1, 1].

  • f32 axis_rx

    The x axis for right pad, mapped to [-1, 1].

  • f32 axis_ry

    The y axis for right pad, mapped to [-1, 1].

  • f32 axis_lt

    The left trigger value, mapped to [0, 1]. For non-linear controllers, the value is either 0 or 1. ControllerButton::lt is also set if this value is greater one system-specified threshold.

  • f32 axis_rt

    The right trigger value, mapped to [0, 1]. For non-linear controllers, the value is either 0 or 1. ControllerButton::rt is also set if this value is greater one system-specified threshold.