hotkey: F7 toggle vsync + F8 next presentation mode amb notificacions

This commit is contained in:
2026-05-19 20:30:16 +02:00
parent 20325ddd5a
commit 74d96047c7
3 changed files with 26 additions and 1 deletions
+21
View File
@@ -62,6 +62,17 @@ namespace GlobalInputs {
Notifications::show(MSG, Notifications::Palette::TOGGLE, Notifications::LONG_MS);
}
void notifyVSync() {
const std::string STATE = Options::video.vsync ? "ON" : "OFF";
const std::string MSG = std::string("VSync ") + STATE;
Notifications::show(MSG, Notifications::Palette::TOGGLE, Notifications::STANDARD_MS);
}
void notifyPresentationMode() {
const std::string MSG = std::string("Mode ") + Screen::getPresentationModeName();
Notifications::show(MSG, Notifications::Palette::CHOICE, Notifications::STANDARD_MS);
}
void onExit() {
const Uint32 NOW = SDL_GetTicks();
if (NOW < exit_window_until_ticks) {
@@ -106,6 +117,16 @@ namespace GlobalInputs {
notifyVersion();
return true;
}
if (Input::get()->checkInput(Input::Action::TOGGLE_VSYNC, Input::Repeat::OFF)) {
Screen::get()->toggleVSync();
notifyVSync();
return true;
}
if (Input::get()->checkInput(Input::Action::NEXT_PRESENTATION_MODE, Input::Repeat::OFF)) {
Screen::get()->nextPresentationMode();
notifyPresentationMode();
return true;
}
// F5/F6 només actuen quan el post-procesado està actiu.
if (Screen::isShaderEnabled()) {
if (Input::get()->checkInput(Input::Action::TOGGLE_SHADER_TYPE, Input::Repeat::OFF)) {