18 #ifndef HEADER_SUPERTUX_CONTROL_JOYSTICK_MANAGER_HPP 19 #define HEADER_SUPERTUX_CONTROL_JOYSTICK_MANAGER_HPP 23 #include <unordered_map> 25 #include "control/controller.hpp" 44 void process_hat_event(
const SDL_JoyHatEvent& jhat);
45 void process_axis_event(
const SDL_JoyAxisEvent& jaxis);
46 void process_button_event(
const SDL_JoyButtonEvent& jbutton);
48 void bind_next_event_to(Control
id);
50 void set_joy_controls(SDL_JoystickID joystick, Control
id,
bool value);
52 void on_joystick_added(
int joystick_index);
53 void on_joystick_removed(
int instance_id);
55 int get_num_joysticks()
const {
return static_cast<int>(joysticks.size()); }
57 void on_player_removed(
int player_id);
58 bool has_corresponding_joystick(
int player_id)
const;
61 int rumble(SDL_Joystick* joystick)
const;
63 void bind_joystick(SDL_Joystick* joystick,
int player_id);
65 std::unordered_map<SDL_Joystick*, int>& get_joystick_mapping() {
return joysticks; }
82 int wait_for_joystick;
84 std::unordered_map<SDL_Joystick*, int> joysticks;
Manages Joysticks.
Definition: joystick_manager.hpp:36
Definition: joystick_config.hpp:28
Definition: keyboard_manager.hpp:30
int rumble(SDL_Joystick *joystick) const
Definition: joystick_manager.cpp:330