diff --git a/thirdparty/rexglue-sdk/src/native/ui/rex_app.cpp b/thirdparty/rexglue-sdk/src/native/ui/rex_app.cpp index 34fba7aa..c7a4ba05 100644 --- a/thirdparty/rexglue-sdk/src/native/ui/rex_app.cpp +++ b/thirdparty/rexglue-sdk/src/native/ui/rex_app.cpp @@ -498,6 +498,19 @@ bool ReXApp::OnInitialize() { window_->AddListener(this); window_->AddInputListener(this, 0); + // F11 toggles borderless fullscreen (rebindable via the bind_fullscreen + // cvar). The change is recorded through the same path as a settings-menu + // edit (SetFlagByName -> user_value), so "Save to config" persists it and + // the next launch starts in the chosen mode. + rex::ui::RegisterBind("bind_fullscreen", "F11", "Toggle fullscreen", [this] { + if (!window_) { + return; + } + bool new_fullscreen = !window_->IsFullscreen(); + window_->SetFullscreen(new_fullscreen); + rex::cvar::SetFlagByName("fullscreen", new_fullscreen ? "true" : "false"); + }); + // Attach window to input system so deferred drivers (e.g. MnK) can register if (runtime_ && runtime_->input_system()) { static_cast(runtime_->input_system())->AttachWindow(window_.get()); @@ -610,6 +623,9 @@ void ReXApp::OnDestroy() { // Notify subclass before cleanup OnShutdown(); + // The fullscreen bind's callback captures this - drop it before teardown. + rex::ui::UnregisterBind("bind_fullscreen"); + // ImGui cleanup (reverse of setup) settings_overlay_.reset(); console_overlay_.reset(); diff --git a/thirdparty/rexglue-sdk/src/ui/keybinds.cpp b/thirdparty/rexglue-sdk/src/ui/keybinds.cpp index 9822f3b6..d77e3d94 100644 --- a/thirdparty/rexglue-sdk/src/ui/keybinds.cpp +++ b/thirdparty/rexglue-sdk/src/ui/keybinds.cpp @@ -209,6 +209,12 @@ void UnregisterBind(std::string_view name) { } bool ProcessKeyEvent(KeyEvent& e) { + // Auto-repeat never fires binds: every bind is a toggle-style action, so a + // held key would fire it once per repeat (fullscreen thrash, overlay + // flicker). Only the initial down transition counts. + if (e.prev_state()) { + return false; + } std::lock_guard lock(g_binds_mutex); for (auto& entry : g_binds) { if (!entry.callback)