ApolloInput Nova 0.2.0
Standalone virtual gamepad library
Loading...
Searching...
No Matches
apollo::input::Device Class Referenceabstract

One created virtual input device. More...

#include <backend.hpp>

Public Member Functions

virtual ~Device ()=default
virtual const DeviceInfo & info () const =0
 Description of the virtual device.
virtual bool connected () const =0
 Whether the device is still connected to its backend.
virtual bool update (const GamepadState &state)=0
 Submit a complete gamepad report.
virtual void set_deadzone (const AnalogDeadzone &deadzone)
 Configure analog drift filtering for this device.
virtual bool update_touchpad (const TouchpadState &state)
 Submit a touchpad report when the backend supports it.
virtual bool update_imu (const ImuSample &sample)
 Submit an IMU sample when the backend supports it.
virtual void set_feedback_callback (FeedbackCallback callback)
 Replace the feedback callback.
virtual void disconnect ()=0
 Remove the virtual device from the system.

Detailed Description

One created virtual input device.

Definition at line 58 of file backend.hpp.

Constructor & Destructor Documentation

◆ ~Device()

virtual apollo::input::Device::~Device ( )
virtualdefault

Member Function Documentation

◆ connected()

virtual bool apollo::input::Device::connected ( ) const
pure virtual

Whether the device is still connected to its backend.

Returns
True when updates can be submitted.

◆ disconnect()

virtual void apollo::input::Device::disconnect ( )
pure virtual

Remove the virtual device from the system.

◆ info()

virtual const DeviceInfo & apollo::input::Device::info ( ) const
pure virtual

Description of the virtual device.

Returns
Immutable device information.

◆ set_deadzone()

virtual void apollo::input::Device::set_deadzone ( const AnalogDeadzone & deadzone)
inlinevirtual

Configure analog drift filtering for this device.

Backends that forward analog axes apply the deadzone before submitting the report. Devices that do not support analog filtering ignore it.

Parameters
deadzoneStick and trigger deadzone configuration.

Definition at line 92 of file backend.hpp.

◆ set_feedback_callback()

virtual void apollo::input::Device::set_feedback_callback ( FeedbackCallback callback)
inlinevirtual

Replace the feedback callback.

Parameters
callbackCallback invoked from the backend thread.

Definition at line 123 of file backend.hpp.

◆ update()

virtual bool apollo::input::Device::update ( const GamepadState & state)
pure virtual

Submit a complete gamepad report.

Parameters
stateButtons, triggers, and sticks.
Returns
True when the backend accepted the report.

◆ update_imu()

virtual bool apollo::input::Device::update_imu ( const ImuSample & sample)
inlinevirtual

Submit an IMU sample when the backend supports it.

Parameters
sampleGyroscope and accelerometer sample.
Returns
True when the backend accepted the sample.

Definition at line 113 of file backend.hpp.

◆ update_touchpad()

virtual bool apollo::input::Device::update_touchpad ( const TouchpadState & state)
inlinevirtual

Submit a touchpad report when the backend supports it.

Parameters
stateTouchpad state.
Returns
True when the backend accepted the report.

Definition at line 102 of file backend.hpp.


The documentation for this class was generated from the following file: