|
ApolloInput Nova 0.2.0
Standalone virtual gamepad library
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | Feedback |
| Feedback payload from the operating system or a game. More... | |
| class | Device |
| One created virtual input device. More... | |
| class | Backend |
| Factory for virtual input devices. More... | |
| struct | ControllerDescription |
| Capabilities reported by a client controller. More... | |
| struct | GamepadState |
| One complete gamepad input report. More... | |
| struct | TouchpadState |
| Optional touchpad report. More... | |
| struct | ImuSample |
| Optional inertial measurement unit sample. More... | |
| struct | Capabilities |
| Features a backend can expose for a profile. More... | |
| struct | ProfileIdentity |
| USB identity used by backends that create HID-style devices. More... | |
| struct | AnalogDeadzone |
| Host-side analog filtering used to remove drift and resting noise. More... | |
| struct | DeviceInfo |
| Description of a created virtual device. More... | |
Typedefs | |
| using | FeedbackCallback = std::function<void(const Feedback &)> |
| Callback invoked when the virtual device receives feedback. | |
Enumerations | |
| enum class | BackendKind { automatic = 0 , vigem , uinput , null_backend } |
| Kind of backend selected by the caller. More... | |
| enum class | FeedbackType { rumble = 0 , led , adaptive_trigger , unknown } |
| Feedback message received from the virtual device. More... | |
| enum class | Profile { xbox_360 , xbox_one , xbox_series , xbox_elite , dualshock4 , dualsense , dualsense_edge , switch_pro , steam_controller , steam_deck , generic } |
| Virtual controller profile exposed by a backend. More... | |
| enum class | ControllerFamily { unknown , xbox , playstation , nintendo , steam , steam_deck } |
| Physical controller family reported by a streaming client. More... | |
| enum class | Button : std::uint32_t { a = 0 , b , x , y , dpad_up , dpad_down , dpad_left , dpad_right , start , back , guide , left_thumb , right_thumb , left_shoulder , right_shoulder , touchpad , touchpad_click , share , options , paddle1 , paddle2 , paddle3 , paddle4 , misc2 } |
| Digital gamepad buttons shared by all backends. More... | |
Functions | |
| std::unique_ptr< Backend > | create_backend (BackendKind kind=BackendKind::automatic) |
| Create a backend for the current platform. | |
| const char * | to_string (BackendKind kind) |
| Convert a backend kind to a stable short name. | |
| bool | backend_from_string (const std::string &name, BackendKind &kind) |
| Parse a backend kind from its short name or a compatible alias. | |
| constexpr std::uint32_t | button_bit (Button button) |
| Bit mask for one digital button. | |
| void | sanitize_gamepad_state (GamepadState &state, const AnalogDeadzone &deadzone={}) |
| Remove stick drift, trigger resting noise, and center jitter. | |
| const char * | to_string (Profile profile) |
| Convert a profile to a stable short name. | |
| bool | profile_from_string (const std::string &name, Profile &profile) |
| Parse a profile from its short name or a compatible alias. | |
| const char * | to_string (ControllerFamily family) |
| Convert a controller family to a stable short name. | |
| bool | controller_family_from_string (const std::string &name, ControllerFamily &family) |
| Parse a controller family from its short name or alias. | |
| Capabilities | profile_capabilities (Profile profile) |
| Features a profile can expose when the backend supports them. | |
| ProfileIdentity | profile_identity (Profile profile) |
| USB identity associated with a profile. | |
| Profile | recommended_profile (const ControllerDescription &controller) |
| Pick the most capable virtual profile for a client controller. | |
| std::vector< Profile > | profile_compatibility_chain (Profile profile) |
| Return a profile followed by progressively simpler alternatives. | |
| using apollo::input::FeedbackCallback = std::function<void(const Feedback &)> |
Callback invoked when the virtual device receives feedback.
Definition at line 53 of file backend.hpp.
|
strong |
Kind of backend selected by the caller.
| Enumerator | |
|---|---|
| automatic | Best backend for the current platform. |
| vigem | ViGEmBus on Windows. |
| uinput | Linux uinput. |
| null_backend | No-op backend useful for tests and previews. |
Definition at line 19 of file backend.hpp.
|
strong |
Digital gamepad buttons shared by all backends.
Definition at line 65 of file gamepad.hpp.
|
strong |
Physical controller family reported by a streaming client.
The family is a hint used to choose a compatible virtual profile. It does not guarantee that every feature of the physical controller can be exposed by the host backend.
Definition at line 37 of file gamepad.hpp.
|
strong |
Feedback message received from the virtual device.
| Enumerator | |
|---|---|
| rumble | Rumble motors. |
| led | LED or lightbar. |
| adaptive_trigger | Adaptive trigger effect. |
| unknown | |
Definition at line 29 of file backend.hpp.
|
strong |
Virtual controller profile exposed by a backend.
Definition at line 16 of file gamepad.hpp.
| bool apollo::input::backend_from_string | ( | const std::string & | name, |
| BackendKind & | kind ) |
Parse a backend kind from its short name or a compatible alias.
Matching is case-insensitive. Aliases include "auto", "vigembus", "linux_uinput", and "none".
| name | Backend name. |
| kind | Receives the parsed kind. |
Definition at line 70 of file backend.cpp.
|
constexpr |
Bit mask for one digital button.
| button | Button to encode. |
Definition at line 98 of file gamepad.hpp.
| bool apollo::input::controller_family_from_string | ( | const std::string & | name, |
| ControllerFamily & | family ) |
Parse a controller family from its short name or alias.
| name | Family name or alias. |
| family | Receives the parsed family. |
Definition at line 191 of file gamepad.cpp.
| std::unique_ptr< Backend > apollo::input::create_backend | ( | BackendKind | kind = BackendKind::automatic | ) |
Create a backend for the current platform.
| kind | Requested backend, or automatic. |
Definition at line 101 of file backend.cpp.
| Capabilities apollo::input::profile_capabilities | ( | Profile | profile | ) |
Features a profile can expose when the backend supports them.
This describes the target profile itself, not the capabilities of a specific backend. A backend intersects this matrix with its own support and reports the result in DeviceInfo::capabilities.
| profile | Virtual controller profile. |
Definition at line 201 of file gamepad.cpp.
Return a profile followed by progressively simpler alternatives.
The first element is always the requested profile. Later elements are safe substitutes that keep standard buttons, sticks, and triggers working when the preferred profile is unavailable on a backend.
| profile | Requested profile. |
Definition at line 337 of file gamepad.cpp.
| bool apollo::input::profile_from_string | ( | const std::string & | name, |
| Profile & | profile ) |
Parse a profile from its short name or a compatible alias.
Matching is case-insensitive. Aliases include Xbox 360/One/Series names, DS4/DS5, Switch, Elite, Edge, Steam, and Deck variants.
| name | Profile name or alias. |
| profile | Receives the parsed profile. |
Definition at line 172 of file gamepad.cpp.
| ProfileIdentity apollo::input::profile_identity | ( | Profile | profile | ) |
USB identity associated with a profile.
Backends that expose HID-style devices can use this identity so SDL, Steam, and udev apply the correct controller mapping.
| profile | Virtual controller profile. |
Definition at line 277 of file gamepad.cpp.
| Profile apollo::input::recommended_profile | ( | const ControllerDescription & | controller | ) |
Pick the most capable virtual profile for a client controller.
The recommendation keeps controller-specific features when possible: touchpads and motion prefer PlayStation/Steam profiles, Nintendo pads use the Switch Pro profile, and Xbox pads use Xbox Series or Xbox Elite.
| controller | Client-reported controller description. |
Definition at line 306 of file gamepad.cpp.
| void apollo::input::sanitize_gamepad_state | ( | GamepadState & | state, |
| const AnalogDeadzone & | deadzone = {} ) |
Remove stick drift, trigger resting noise, and center jitter.
The stick deadzone is radial, so diagonal drift is handled consistently on both axes. Values outside the deadzone are rescaled to preserve full travel.
| state | Gamepad state to sanitize in place. |
| deadzone | Deadzone configuration. |
Definition at line 484 of file gamepad.cpp.
| const char * apollo::input::to_string | ( | BackendKind | kind | ) |
Convert a backend kind to a stable short name.
| kind | Backend kind. |
Definition at line 61 of file backend.cpp.
| const char * apollo::input::to_string | ( | ControllerFamily | family | ) |
Convert a controller family to a stable short name.
| family | Controller family. |
Definition at line 182 of file gamepad.cpp.
| const char * apollo::input::to_string | ( | Profile | profile | ) |
Convert a profile to a stable short name.
| profile | Profile to convert. |
Definition at line 163 of file gamepad.cpp.