19#ifndef HEADER_GAMEPD_CONFIG_HPP
20#define HEADER_GAMEPD_CONFIG_HPP
22#include "input/binding.hpp"
23#include "input/device_config.hpp"
24#include "input/input.hpp"
25#include "utils/cpp2011.hpp"
26#include "utils/no_copy.hpp"
62 bool m_use_force_feedback;
65 std::map<std::tuple<int, Input::AxisDirection>,
int> m_sdl_mapping;
67 std::set<int> m_digital_axes;
69 bool getMappingTuple(
const std::string& rhs,
70 std::tuple<int, Input::AxisDirection>& t);
72 std::tuple<int, Input::AxisDirection>& t);
77 const int axis_count=0,
78 const int button_ount=0);
83 virtual void save(std::ofstream& stream) OVERRIDE;
84 void setDefaultBinds ();
89 virtual bool isAnalog(Input::InputType type,
int id)
const OVERRIDE;
116 virtual bool isGamePad() const OVERRIDE {
return true; }
118 virtual bool isKeyboard() const OVERRIDE {
return false; }
120 void initSDLController(
const std::string& mapping,
int buttons,
int axes,
123 void initSDLMapping();
125 bool useForceFeedback()
const {
return m_use_force_feedback; }
127 void setForceFeedback(
bool val) { m_use_force_feedback = val; }
129 int getAutoCenterStrength()
const {
return m_auto_center; }
131 void setAutoCenter(
bool val) { m_auto_center = val; }
contains the key bindings information related to one input device
Definition: device_config.hpp:42
specialisation of DeviceConfig for gamepad type devices
Definition: gamepad_config.hpp:43
int m_button_count
Number of buttons this device has.
Definition: gamepad_config.hpp:53
int m_deadzone
Deadzone of this gamepad.
Definition: gamepad_config.hpp:56
void setNumberOfAxis(int count)
Sets the number of axis this device has.
Definition: gamepad_config.hpp:110
virtual bool desensitize() const OVERRIDE
Returns true if this device should desensitize its input at values close to 0 (to avoid 'oversteering...
Definition: gamepad_config.hpp:94
int m_axis_count
Number of axis this device has.
Definition: gamepad_config.hpp:47
void setNumberOfButtons(int count)
Sets the number of buttons this device has.
Definition: gamepad_config.hpp:102
virtual core::stringw getBindingAsString(const PlayerAction action) const OVERRIDE
Get a user-readable string describing the bound action.
Definition: gamepad_config.cpp:147
virtual bool load(const XMLNode *config) OVERRIDE
Loads this configuration from the given XML node.
Definition: gamepad_config.cpp:90
int m_hat_count
Number of hat this device has.
Definition: gamepad_config.hpp:50
virtual int getNumberOfButtons() const OVERRIDE
Returns the number of buttons in this configuration.
Definition: gamepad_config.hpp:98
virtual bool isAnalog(Input::InputType type, int id) const OVERRIDE
Returns if this device uses analog axes.
Definition: gamepad_config.cpp:614
bool m_desensitize
If set to true, map any analog axis from x in [0,1] to x^x --> at values close to 0 the joystick will...
Definition: gamepad_config.hpp:60
core::stringw toString()
Converts the configuration to a string.
Definition: gamepad_config.cpp:235
int getDeadzone() const
Return deadzone of this configuration.
Definition: gamepad_config.hpp:114
virtual int getNumberOfAxes() const OVERRIDE
Returns the number of axis of this configufation.
Definition: gamepad_config.hpp:106
virtual void save(std::ofstream &stream) OVERRIDE
Saves the configuration to a file.
Definition: gamepad_config.cpp:112
Definition: sdl_controller.hpp:36
utility class used to parse XML files
Definition: xml_node.hpp:48