soport de gamepad per a wasm
This commit is contained in:
@@ -92,6 +92,15 @@ void Title::handleEvent(const SDL_Event& event) {
|
||||
return; // No procesar más este evento
|
||||
}
|
||||
|
||||
// Qualsevol botó del comandament al menú principal inicia partida directament
|
||||
// (els bindings ja estan definits, no cal "pulsar 1" amb el teclat).
|
||||
if (event.type == SDL_EVENT_GAMEPAD_BUTTON_DOWN &&
|
||||
state_ == State::MAIN_MENU &&
|
||||
!is_remapping_keyboard_ && !is_remapping_joystick_) {
|
||||
handleMainMenuKeyPress(SDLK_1); // PLAY
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && !Console::get()->isActive()) {
|
||||
// Si estamos en modo remap de teclado, capturar tecla
|
||||
if (is_remapping_keyboard_ && !remap_completed_) {
|
||||
|
||||
Reference in New Issue
Block a user