19 #ifndef DEVICE_MANAGER_HPP 20 #define DEVICE_MANAGER_HPP 22 #include "input/gamepad_config.hpp" 23 #include "input/input_manager.hpp" 24 #include "input/keyboard_config.hpp" 25 #include "states_screens/state_manager.hpp" 26 #include "utils/no_copy.hpp" 27 #include "utils/ptr_vector.hpp" 30 #include <IEventReceiver.h> 73 PlayerAssignMode m_assign_mode;
86 InputDevice *mapGamepadInput( Input::InputType type,
int deviceID,
87 int btnID,
int axisDir,
89 InputManager::InputDriverMode mode,
93 InputManager::InputDriverMode mode,
107 PlayerAssignMode getAssignMode()
const {
return m_assign_mode; }
108 void setAssignMode(
const PlayerAssignMode assignMode);
112 int getGamePadAmount()
const {
return m_gamepads.size(); }
113 int getGamePadConfigAmount()
const {
return m_gamepad_configs.size(); }
114 GamePadDevice* getGamePad(
const int i) {
return m_gamepads.get(i); }
115 GamepadConfig* getGamepadConfig(
const int i) {
return m_gamepad_configs.get(i); }
117 void clearGamepads();
119 bool getConfigForGamepad(
const int sdl_id,
120 const std::string& name,
124 void addEmptyKeyboard();
126 void clearKeyboard();
127 int getKeyboardAmount() {
return m_keyboards.size(); }
128 int getActiveKeyboardAmount()
131 for (
unsigned int i=0;i<m_keyboard_configs.size();i++)
133 if (m_keyboard_configs[i].isEnabled()) active++;
137 int getKeyboardConfigAmount()
const {
return m_keyboard_configs.size(); }
138 KeyboardDevice* getKeyboard(
const int i) {
return m_keyboards.get(i); }
139 KeyboardConfig* getKeyboardConfig(
const int i) {
return m_keyboard_configs.get(i); }
144 void clearMultitouchDevices();
145 void updateMultitouchDevice();
162 bool translateInput( Input::InputType type,
167 InputManager::InputDriverMode mode,
171 void clearLatestUsedDevice();
bool m_map_fire_to_select
If this is flag is set the next fire event (if the fire key is not mapped to anything else) will be m...
Definition: device_manager.hpp:83
Represents a player that is currently playing.
Definition: state_manager.hpp:75
Definition: multitouch_device.hpp:75
contains the key bindings information related to one input device
Definition: device_config.hpp:41
StateManager::ActivePlayer * m_single_player
Will be non-null in single-player mode.
Definition: device_manager.hpp:77
specialisation of Inputdevice for gamepad type devices
Definition: gamepad_device.hpp:32
Definition: three_d_animation.hpp:32
specialisation of InputDevice for keyboard type devices
Definition: keyboard_device.hpp:33
specialisation of DeviceConfig for gamepad type devices
Definition: gamepad_config.hpp:42
specialisation of DeviceConfig for keyboard type devices
Definition: keyboard_config.hpp:34
void setSinglePlayer(StateManager::ActivePlayer *p)
Sets the ActivePlayer if there is only a single local player.
Definition: device_manager.hpp:187
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:25
void mapFireToSelect(bool v)
Sets or reset the 'map fire to select' option.
Definition: device_manager.hpp:194
StateManager::ActivePlayer * getSinglePlayer()
Returns the active player if there is only a single local player.
Definition: device_manager.hpp:179
This class holds the list of all known devices (ands their configurations), as well as the list of cu...
Definition: device_manager.hpp:62