Send joystick added events on portable handheld platforms
The IDs on these drivers are hard-coded as device_index + 1, so that's the ID we will send during initialization.
This commit is contained in:
@@ -76,6 +76,8 @@ extern "C"
|
|||||||
SDL_joyname[numjoysticks] = SDL_CreateJoystickName(0, 0, NULL, stick_name.String());
|
SDL_joyname[numjoysticks] = SDL_CreateJoystickName(0, 0, NULL, stick_name.String());
|
||||||
numjoysticks++;
|
numjoysticks++;
|
||||||
joystick.Close();
|
joystick.Close();
|
||||||
|
|
||||||
|
SDL_PrivateJoystickAdded(numjoysticks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ static void UpdateN3DSCStick(Uint64 timestamp, SDL_Joystick *joystick);
|
|||||||
static int N3DS_JoystickInit(void)
|
static int N3DS_JoystickInit(void)
|
||||||
{
|
{
|
||||||
hidInit();
|
hidInit();
|
||||||
|
SDL_PrivateJoystickAdded(1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ static int PS2_JoystickInit(void)
|
|||||||
info->slot = (uint8_t)slot;
|
info->slot = (uint8_t)slot;
|
||||||
info->opened = 1;
|
info->opened = 1;
|
||||||
enabled_pads++;
|
enabled_pads++;
|
||||||
|
SDL_PrivateJoystickAdded(enabled_pads);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ static int PSP_JoystickInit(void)
|
|||||||
analog_map[127 - i] = -1 * analog_map[i + 128];
|
analog_map[127 - i] = -1 * analog_map[i + 128];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_PrivateJoystickAdded(1);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,8 @@ static int VITA_JoystickInit(void)
|
|||||||
// after the app has already started.
|
// after the app has already started.
|
||||||
|
|
||||||
SDL_numjoysticks = 1;
|
SDL_numjoysticks = 1;
|
||||||
SDL_PrivateJoystickAdded(0);
|
SDL_PrivateJoystickAdded(SDL_numjoysticks);
|
||||||
|
|
||||||
// How many additional paired controllers are there?
|
// How many additional paired controllers are there?
|
||||||
sceCtrlGetControllerPortInfo(&myPortInfo);
|
sceCtrlGetControllerPortInfo(&myPortInfo);
|
||||||
|
|
||||||
@@ -132,8 +133,8 @@ static int VITA_JoystickInit(void)
|
|||||||
// and that is the first one, so start at port 2
|
// and that is the first one, so start at port 2
|
||||||
for (i = 2; i <= 4; i++) {
|
for (i = 2; i <= 4; i++) {
|
||||||
if (myPortInfo.port[i] != SCE_CTRL_TYPE_UNPAIRED) {
|
if (myPortInfo.port[i] != SCE_CTRL_TYPE_UNPAIRED) {
|
||||||
|
++SDL_numjoysticks;
|
||||||
SDL_PrivateJoystickAdded(SDL_numjoysticks);
|
SDL_PrivateJoystickAdded(SDL_numjoysticks);
|
||||||
SDL_numjoysticks++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return SDL_numjoysticks;
|
return SDL_numjoysticks;
|
||||||
|
|||||||
Reference in New Issue
Block a user