ui: F1-F12 i ESC deixen de comptar com a any-key skip (logo/intro/instructions/title/demo)

This commit is contained in:
2026-05-19 20:03:11 +02:00
parent 1129f1116e
commit bded70a52a
5 changed files with 40 additions and 11 deletions
+10 -1
View File
@@ -952,7 +952,16 @@ void Title::handleEvent(const SDL_Event *event) {
}
if (section_->subsection == SUBSECTION_TITLE_3) {
if ((event->type == SDL_EVENT_KEY_UP) || (event->type == SDL_EVENT_JOYSTICK_BUTTON_UP)) {
// Activa menu i reinicia el countdown de demo nomes amb tecles "humanes".
// F1-F12 i ESC son hotkeys globals (zoom, fullscreen, shaders, exit, version)
// i no han d'interferir amb el flux de l'UI del titol.
bool human_input = (event->type == SDL_EVENT_JOYSTICK_BUTTON_UP);
if (event->type == SDL_EVENT_KEY_UP) {
const SDL_Scancode S = event->key.scancode;
const bool IS_RESERVED = (S == SDL_SCANCODE_ESCAPE) || (S >= SDL_SCANCODE_F1 && S <= SDL_SCANCODE_F12);
human_input = !IS_RESERVED;
}
if (human_input) {
menu_visible_ = true;
demo_remaining_s_ = DEMO_TIMEOUT_S;
}