Implementat control de repetició per als eixos del joystick

This commit is contained in:
2025-02-06 12:36:16 +01:00
parent 270d7d1848
commit 3cebee2ae4
2 changed files with 47 additions and 9 deletions

View File

@@ -81,10 +81,11 @@ private:
{
SDL_GameControllerButton button; // GameControllerButton asociado
bool active; // Indica si está activo
bool axis_active; // Estado del eje
// Constructor
explicit ControllerBindings(SDL_GameControllerButton btn = SDL_CONTROLLER_BUTTON_INVALID, bool act = false)
: button(btn), active(act) {}
explicit ControllerBindings(SDL_GameControllerButton btn = SDL_CONTROLLER_BUTTON_INVALID, bool act = false, bool axis_act = false)
: button(btn), active(act), axis_active(axis_act) {}
};
// Variables
@@ -99,7 +100,7 @@ private:
std::string game_controller_db_path_; // Ruta al archivo gamecontrollerdb.txt
// Comprueba el eje del mando
bool checkAxisInput(InputType input, int controller_index = 0) const;
bool checkAxisInput(InputType input, int controller_index, bool repeat);
// Constructor
explicit Input(const std::string &game_controller_db_path);