supertux
Public Member Functions | Friends | List of all members
JoystickManager Class Referencefinal

Manages Joysticks. More...

#include <joystick_manager.hpp>

Public Member Functions

 JoystickManager (InputManager *parent, JoystickConfig &joystick_config)
 
void process_hat_event (const SDL_JoyHatEvent &jhat)
 
void process_axis_event (const SDL_JoyAxisEvent &jaxis)
 
void process_button_event (const SDL_JoyButtonEvent &jbutton)
 
void bind_next_event_to (Control id)
 
void set_joy_controls (SDL_JoystickID joystick, Control id, bool value)
 
void on_joystick_added (int joystick_index)
 
void on_joystick_removed (int instance_id)
 
int get_num_joysticks () const
 
void on_player_removed (int player_id)
 
bool has_corresponding_joystick (int player_id) const
 
int rumble (SDL_Joystick *joystick) const
 
void bind_joystick (SDL_Joystick *joystick, int player_id)
 
std::unordered_map< SDL_Joystick *, int > & get_joystick_mapping ()
 

Friends

class KeyboardManager
 

Detailed Description

Manages Joysticks.

WARNING: Any edit done to this class should also be done to GameControllerManager!

Member Function Documentation

◆ rumble()

int JoystickManager::rumble ( SDL_Joystick *  joystick) const
Returns
0 if success, 1 if controller doesn't support rumbling, 2 if game doesn't support rumbling

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