dual_sense_hid::Gamepad class

Gamepad handle used to poll state from device.

Public types

class Lights
Proxy object for calls which mutate state of gamepad's lights.

Constructors, destructors, conversion operators

Gamepad(const DeviceInfo& device_info, bool fetch_calibration_data = true) explicit
Constructor.

Public functions

auto poll(bool use_calibration_data = true) const -> State
Poll state of gamepad from report queue.
void push_state(bool full_update = false)
Push internal gamepad state to real device.
auto get_calibration_data() const -> const Calibration&
Get calibration data (cached)
auto lights() -> Lights&
Get gamepad's lights proxy object.

Function documentation

dual_sense_hid::Gamepad::Gamepad(const DeviceInfo& device_info, bool fetch_calibration_data = true) explicit

Constructor.

Parameters
device_info Device info to create gamepad instance for
fetch_calibration_data Prefetch calibration data while initializing (default: true)

State dual_sense_hid::Gamepad::poll(bool use_calibration_data = true) const

Poll state of gamepad from report queue.

Parameters
use_calibration_data Apply accelerometer & gyroscope calibration data to readings
Returns A state of gamepad associated with current object

void dual_sense_hid::Gamepad::push_state(bool full_update = false)

Push internal gamepad state to real device.

Parameters
full_update When set to false push only changed sections, otherwise push everything

const Calibration& dual_sense_hid::Gamepad::get_calibration_data() const

Get calibration data (cached)

Returns Calibration data from gamepad

Lights& dual_sense_hid::Gamepad::lights()

Get gamepad's lights proxy object.

Returns Gamepad's lights proxy object