diff --git a/src/joystick/wiiu/SDL_wiiujoystick.c b/src/joystick/wiiu/SDL_wiiujoystick.c index cf7bdbe53..d345b24e7 100644 --- a/src/joystick/wiiu/SDL_wiiujoystick.c +++ b/src/joystick/wiiu/SDL_wiiujoystick.c @@ -225,7 +225,16 @@ static const char *WIIU_JoystickGetDeviceName(int device_index) /* Function to get the player index of a joystick */ static int WIIU_JoystickGetDevicePlayerIndex(int device_index) { - return -1; + int wiiu_device = WIIU_GetDeviceForIndex(device_index); + switch (wiiu_device) { + case WIIU_DEVICE_GAMEPAD: { return 0; } + case WIIU_DEVICE_WPAD(1): { return 1; } + case WIIU_DEVICE_WPAD(2): { return 2; } + case WIIU_DEVICE_WPAD(3): { return 3; } + case WIIU_DEVICE_WPAD(4): { return 4; } + default: { return -1; } + } + } /* Function to return the stable GUID for a plugged in device */