Skip to content

[rcore] Gamepad not working on macOS #3651

Open
@NitroPlum

Description

@NitroPlum

Please, before submitting a new issue verify and check:

  • I tested it on latest raylib version from master branch
  • I checked there is no similar issue already reported
  • I checked the documentation on the wiki
  • My code has no errors or misuse of raylib

Issue description

Gamepad input not working. I tried 2 different controllers.

  • Xbox One Series X connected via USB
    • IsGamepadAvailable(0) returns false.
  • Nintendo Switch Pro Controller connected via USB
    • IsGamepadAvailable(0) returns true.
    • No button input is ever detected

Environment

MacOSX Ventura on an M2 Mac.

Issue Screenshot

Can't really show this.

Code Example

#include "raylib.h"
#include <stdio.h>

int main(void)
{
    const int screenWidth = 800;
    const int screenHeight = 450;

    InitWindow(screenWidth, screenHeight, "Gamepads Broken");

    SetTargetFPS(60);               

    while (!WindowShouldClose()) 
    {
        BeginDrawing();

            ClearBackground(RAYWHITE);

            if(IsGamepadAvailable(0)) {
                DrawText("FOUND GAMEPAD TEST", 190, 275, 20, PURPLE);
                
                if(IsGamepadButtonDown(0, GAMEPAD_BUTTON_RIGHT_FACE_DOWN)) {
                    DrawText("BUTTON PRESSED", 190, 350, 20, PURPLE);
                }
            }

        EndDrawing();
    }
    CloseWindow();        

    return 0;
}

Provide minimal reproduction code to test the issue. Please, format the code properly and try to keep it as simple as possible, just focusing on the experienced issue.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions