ApolloInput Nova 0.2.0
Standalone virtual gamepad library
Loading...
Searching...
No Matches
gamepad.hpp File Reference

Portable gamepad state, profiles, and capability definitions. More...

#include <cstdint>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  apollo::input::ControllerDescription
 Capabilities reported by a client controller. More...
struct  apollo::input::GamepadState
 One complete gamepad input report. More...
struct  apollo::input::TouchpadState
 Optional touchpad report. More...
struct  apollo::input::ImuSample
 Optional inertial measurement unit sample. More...
struct  apollo::input::Capabilities
 Features a backend can expose for a profile. More...
struct  apollo::input::ProfileIdentity
 USB identity used by backends that create HID-style devices. More...
struct  apollo::input::AnalogDeadzone
 Host-side analog filtering used to remove drift and resting noise. More...
struct  apollo::input::DeviceInfo
 Description of a created virtual device. More...

Namespaces

namespace  apollo
namespace  apollo::input

Enumerations

enum class  apollo::input::Profile {
  apollo::input::xbox_360 , apollo::input::xbox_one , apollo::input::xbox_series , apollo::input::xbox_elite ,
  apollo::input::dualshock4 , apollo::input::dualsense , apollo::input::dualsense_edge , apollo::input::switch_pro ,
  apollo::input::steam_controller , apollo::input::steam_deck , apollo::input::generic
}
 Virtual controller profile exposed by a backend. More...
enum class  apollo::input::ControllerFamily {
  apollo::input::unknown , apollo::input::xbox , apollo::input::playstation , apollo::input::nintendo ,
  apollo::input::steam , apollo::input::steam_deck
}
 Physical controller family reported by a streaming client. More...
enum class  apollo::input::Button : std::uint32_t {
  apollo::input::a = 0 , apollo::input::b , apollo::input::x , apollo::input::y ,
  apollo::input::dpad_up , apollo::input::dpad_down , apollo::input::dpad_left , apollo::input::dpad_right ,
  apollo::input::start , apollo::input::back , apollo::input::guide , apollo::input::left_thumb ,
  apollo::input::right_thumb , apollo::input::left_shoulder , apollo::input::right_shoulder , apollo::input::touchpad ,
  apollo::input::touchpad_click , apollo::input::share , apollo::input::options , apollo::input::paddle1 ,
  apollo::input::paddle2 , apollo::input::paddle3 , apollo::input::paddle4 , apollo::input::misc2
}
 Digital gamepad buttons shared by all backends. More...

Functions

constexpr std::uint32_t apollo::input::button_bit (Button button)
 Bit mask for one digital button.
void apollo::input::sanitize_gamepad_state (GamepadState &state, const AnalogDeadzone &deadzone={})
 Remove stick drift, trigger resting noise, and center jitter.
const char * apollo::input::to_string (Profile profile)
 Convert a profile to a stable short name.
bool apollo::input::profile_from_string (const std::string &name, Profile &profile)
 Parse a profile from its short name or a compatible alias.
const char * apollo::input::to_string (ControllerFamily family)
 Convert a controller family to a stable short name.
bool apollo::input::controller_family_from_string (const std::string &name, ControllerFamily &family)
 Parse a controller family from its short name or alias.
Capabilities apollo::input::profile_capabilities (Profile profile)
 Features a profile can expose when the backend supports them.
ProfileIdentity apollo::input::profile_identity (Profile profile)
 USB identity associated with a profile.
Profile apollo::input::recommended_profile (const ControllerDescription &controller)
 Pick the most capable virtual profile for a client controller.
std::vector< Profile > apollo::input::profile_compatibility_chain (Profile profile)
 Return a profile followed by progressively simpler alternatives.

Detailed Description

Portable gamepad state, profiles, and capability definitions.

Definition in file gamepad.hpp.