ui: F1-F12 i ESC deixen de comptar com a any-key skip (logo/intro/instructions/title/demo)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user