122 static void saveConfiguration(
const std::string & outputPath,
const std::string &
guid,
const std::string &
name,
const std::vector<int> & axesMapping,
const std::vector<int> & buttonsMapping);
131 static bool parseConfiguration(
const std::string & settingsContent, std::vector<int> & axesMapping, std::vector<int> & buttonsMapping);
146 float _axes[Controller::Input::InputCount];
Represents a joystick or any additional controller.
Definition: Controller.hpp:9
Controller(Controller &&)=delete
int id() const
Definition: Controller.hpp:83
static bool parseConfiguration(const std::string &settingsContent, std::vector< int > &axesMapping, std::vector< int > &buttonsMapping)
Definition: Controller.cpp:84
Controller & operator=(const Controller &)=delete
ControllerButton _buttons[Controller::Input::InputCount]
States of all possible buttons.
Definition: Controller.hpp:145
virtual bool activate(int id)=0
bool triggered(const Controller::Input &input, bool absorb=false)
Definition: Controller.cpp:25
std::string name() const
Definition: Controller.hpp:88
virtual ~Controller()=default
Destructor.
Controller()
Constructor.
Definition: Controller.cpp:7
Input
Controller inputs, based on the Xbox controller layout.
Definition: Controller.hpp:16
std::string guid() const
Definition: Controller.hpp:93
Controller(const Controller &)=delete
void reset()
Definition: Controller.cpp:11
virtual void deactivate()=0
static void saveConfiguration(const std::string &outputPath, const std::string &guid, const std::string &name, const std::vector< int > &axesMapping, const std::vector< int > &buttonsMapping)
Definition: Controller.cpp:37
int _id
Joystick ID (or -1 if no joystick is connected).
Definition: Controller.hpp:148
Controller & operator=(Controller &&)=delete
std::string _guid
GUID of the joystick.
Definition: Controller.hpp:150
float _axes[Controller::Input::InputCount]
States of all possible axis.
Definition: Controller.hpp:146
bool pressed(const Controller::Input &input) const
Definition: Controller.cpp:21
float axis(const Controller::Input &input) const
Definition: Controller.cpp:33
std::string _name
Name of the joystick.
Definition: Controller.hpp:149