From 18ab694f703ee4b185935b5bdd5a533ea05933d2 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 21 Jan 2021 14:39:03 +0100 Subject: [PATCH] ADDED: SetGamepadMappings() #1506 --- src/core.c | 8 ++++++++ src/raylib.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/core.c b/src/core.c index 4162e8936..5549fc9d2 100644 --- a/src/core.c +++ b/src/core.c @@ -2976,6 +2976,14 @@ int GetGamepadButtonPressed(void) return CORE.Input.Gamepad.lastButtonPressed; } +// Set internal gamepad mappings +int SetGamepadMappings(const char *mappings) +{ +#if defined(PLATFORM_DESKTOP) + return glfwUpdateGamepadMappings(mappings); +#endif +} + // Detect if a mouse button has been pressed once bool IsMouseButtonPressed(int button) { diff --git a/src/raylib.h b/src/raylib.h index 24992a4f6..4e72fb6b8 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1035,6 +1035,7 @@ RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gam RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed RLAPI int GetGamepadAxisCount(int gamepad); // Return gamepad axis count for a gamepad RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis +RLAPI int SetGamepadMappings(const char *mappings); // Set internal gamepad mappings (SDL_GameControllerDB) // Input-related functions: mouse RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once