Switch Controller
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Controller Class Reference

#include <Controller.h>

Collaboration diagram for Controller:
Collaboration graph

Public Types

enum  stickIndicies { left , right , hat }
 

Public Member Functions

 Controller (const boost::program_options::variables_map &vm)
 
std::array< uint8_t, 8 > getData () const
 

Static Public Member Functions

static auto getButtons (const boost::program_options::variables_map &vm)
 
static constexpr auto convertSFML_Axis (float pos)
 
static auto getSticks (const boost::program_options::variables_map &vm)
 
static constexpr std::array< uint8_t, 2 > digtalToAnalogConversion (bool up, bool right, bool down, bool left)
 
static constexpr std::array< bool, 4 > analogToDigitalConversion (std::array< uint8_t, 2 > sticks)
 
static constexpr std::array< uint8_t, 2 > adjustStickValueForDeadzone (std::array< uint8_t, 2 > sticks)
 
static constexpr uint8_t convertSticksToHat (std::array< uint8_t, 2 > sticks)
 

Static Public Attributes

static constexpr auto buttonMapping
 
static constexpr int JOYSTICK_DEADZONE = 30
 

Member Enumeration Documentation

◆ stickIndicies

Enumerator
left 
right 
hat 

Constructor & Destructor Documentation

◆ Controller()

Controller::Controller ( const boost::program_options::variables_map &  vm)
inline

Member Function Documentation

◆ adjustStickValueForDeadzone()

static constexpr std::array< uint8_t, 2 > Controller::adjustStickValueForDeadzone ( std::array< uint8_t, 2 >  sticks)
inlinestaticconstexpr

◆ analogToDigitalConversion()

static constexpr std::array< bool, 4 > Controller::analogToDigitalConversion ( std::array< uint8_t, 2 >  sticks)
inlinestaticconstexpr

◆ convertSFML_Axis()

static constexpr auto Controller::convertSFML_Axis ( float  pos)
inlinestaticconstexpr

◆ convertSticksToHat()

static constexpr uint8_t Controller::convertSticksToHat ( std::array< uint8_t, 2 >  sticks)
inlinestaticconstexpr

◆ digtalToAnalogConversion()

static constexpr std::array< uint8_t, 2 > Controller::digtalToAnalogConversion ( bool  up,
bool  right,
bool  down,
bool  left 
)
inlinestaticconstexpr

◆ getButtons()

static auto Controller::getButtons ( const boost::program_options::variables_map &  vm)
inlinestatic

◆ getData()

std::array< uint8_t, 8 > Controller::getData ( ) const
inline

◆ getSticks()

static auto Controller::getSticks ( const boost::program_options::variables_map &  vm)
inlinestatic

Member Data Documentation

◆ buttonMapping

constexpr auto Controller::buttonMapping
staticconstexpr
Initial value:
= std::array{
"controls.y"sv, "controls.b"sv, "controls.a"sv,
"controls.x"sv, "controls.l"sv, "controls.r"sv,
"controls.xl"sv, "controls.xr"sv, "controls.Select"sv,
"controls.start"sv, "controls.lClick"sv, "controls.rClick"sv,
"controls.home"sv, "controls.capture"sv,
}

◆ JOYSTICK_DEADZONE

constexpr int Controller::JOYSTICK_DEADZONE = 30
staticconstexpr

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