fix: corregit el tractament de mandos connectats
This commit is contained in:
@@ -695,6 +695,25 @@ SDL_AppResult Director::handleEvent(SDL_Event *event) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Hot-plug de mandos
|
||||
if (event->type == SDL_EVENT_GAMEPAD_ADDED) {
|
||||
std::string name;
|
||||
if (input->handleGamepadAdded(event->gdevice.which, name)) {
|
||||
screen->notify(name + " " + lang->getText(94),
|
||||
color_t{0x40, 0xFF, 0x40},
|
||||
color_t{0, 0, 0},
|
||||
2500);
|
||||
}
|
||||
} else if (event->type == SDL_EVENT_GAMEPAD_REMOVED) {
|
||||
std::string name;
|
||||
if (input->handleGamepadRemoved(event->gdevice.which, name)) {
|
||||
screen->notify(name + " " + lang->getText(95),
|
||||
color_t{0xFF, 0x50, 0x50},
|
||||
color_t{0, 0, 0},
|
||||
2500);
|
||||
}
|
||||
}
|
||||
|
||||
// Gestiona la visibilidad del cursor según el movimiento del ratón
|
||||
Mouse::handleEvent(*event, options->videoMode != 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user