afegit fix de mandos en emscripten android

This commit is contained in:
2026-04-16 19:35:48 +02:00
parent a36662ac6e
commit d3bdd9b783
2 changed files with 90 additions and 23 deletions

View File

@@ -260,8 +260,10 @@ void Director::handleEvent(const SDL_Event& event) {
JG_QuitSignal();
requestQuit();
}
// Hot-plug de gamepad
if (event.type == SDL_EVENT_GAMEPAD_ADDED || event.type == SDL_EVENT_GAMEPAD_REMOVED) {
// Hot-plug de gamepad (a Emscripten els dispositius web entren com
// JOYSTICK_ADDED/REMOVED perquè SDL no reconeix el GUID)
if (event.type == SDL_EVENT_GAMEPAD_ADDED || event.type == SDL_EVENT_GAMEPAD_REMOVED ||
event.type == SDL_EVENT_JOYSTICK_ADDED || event.type == SDL_EVENT_JOYSTICK_REMOVED) {
Gamepad::handleEvent(event);
return;
}