fix: corregit el tractament de mandos connectats

This commit is contained in:
2026-04-13 17:11:27 +02:00
parent 66c3e0089c
commit dfe0a3d4e6
7 changed files with 167 additions and 22 deletions

View File

@@ -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);