diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4cc3ebdc9..fbd8d4bcf 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,12 @@ - +24.12.29.1 +========== + + Added a new display mode to blackout secondary monitors while playing + games (Refer to Display | ADHD Multi-Monitor Mode). + + Added keybind for ADHD Multi-Monitor Mode to Monitor Management keys + in the Display menu. + + Added command console variable to toggle this mode: + + Display.MultiMonitorFocus {true|false} Default: false 24.12.29 ======== diff --git a/include/SpecialK/config.h b/include/SpecialK/config.h index c04f09d94..9364ad2ec 100644 --- a/include/SpecialK/config.h +++ b/include/SpecialK/config.h @@ -658,6 +658,13 @@ struct sk_config_t false, false, false, 0 }, L"ToggleHDR" }; + SK_ConfigSerializedKeybind + multimonitor_focus_keybind = { + SK_Keybind { + "Toggle ADHD MultiMonitor Mode", L"", + false, false, false, 0 + }, L"ToggleADHDMultiMonitor" + }; } monitors; struct widget_s { diff --git a/src/config.cpp b/src/config.cpp index f28b3e62e..7630e73b3 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -1678,20 +1678,21 @@ auto DeclKeybind = ConfigEntry (screenshots.png.store_hdr, L"Use HDR PNG file format for HDR screenshots", osd_ini, L"Screenshot.HDR", L"StorePNG"), ConfigEntry (screenshots.allow_hdr_clipboard, L"Use HDR for Windows Clipboard screenshots", osd_ini, L"Screenshot.HDR", L"AllowClipboardHDR"), ConfigEntry (screenshots.png.st2084_bits, L"Use n-bit Quantization to save Disk Space", osd_ini, L"Screenshot.HDR", L"MaxST2084QuantizedBits"), - Keybind ( &config.render.keys.hud_toggle, L"Toggle Game's HUD", osd_ini, L"Game.HUD"), - Keybind ( &config.osd.keys.console_toggle, L"Toggle SK's Command Console", osd_ini, L"OSD.System"), - Keybind ( &config.screenshots.game_hud_free_keybind, L"Take a screenshot without the HUD", osd_ini, L"Screenshot.System"), - Keybind ( &config.screenshots.sk_osd_free_keybind, L"Take a screenshot without SK's OSD", osd_ini, L"Screenshot.System"), - Keybind ( &config.screenshots. + Keybind (&config.render.keys.hud_toggle, L"Toggle Game's HUD", osd_ini, L"Game.HUD"), + Keybind (&config.osd.keys.console_toggle, L"Toggle SK's Command Console", osd_ini, L"OSD.System"), + Keybind (&config.screenshots.game_hud_free_keybind, L"Take a screenshot without the HUD", osd_ini, L"Screenshot.System"), + Keybind (&config.screenshots.sk_osd_free_keybind, L"Take a screenshot without SK's OSD", osd_ini, L"Screenshot.System"), + Keybind (&config.screenshots. sk_osd_insertion_keybind, L"Take a screenshot and insert SK's OSD", osd_ini, L"Screenshot.System"), - Keybind ( &config.screenshots.no_3rd_party_keybind, L"Take a screenshot before third-party overlays", osd_ini, L"Screenshot.System"), - Keybind ( &config.screenshots.clipboard_only_keybind,L"Take a screenshot and copy it to the clipboard only", osd_ini, L"Screenshot.System"), - Keybind ( &config.screenshots.snipping_keybind, L"Snip a screenshot and copy it to the clipboard", osd_ini, L"Screenshot.System"), + Keybind (&config.screenshots.no_3rd_party_keybind, L"Take a screenshot before third-party overlays", osd_ini, L"Screenshot.System"), + Keybind (&config.screenshots.clipboard_only_keybind, L"Take a screenshot and copy it to the clipboard only", osd_ini, L"Screenshot.System"), + Keybind (&config.screenshots.snipping_keybind, L"Snip a screenshot and copy it to the clipboard", osd_ini, L"Screenshot.System"), - Keybind ( &config.monitors.monitor_primary_keybind, L"Move Game to Primary Monitor", osd_ini, L"Display.Monitor"), - Keybind ( &config.monitors.monitor_next_keybind, L"Move Game to Next Monitor", osd_ini, L"Display.Monitor"), - Keybind ( &config.monitors.monitor_prev_keybind, L"Move Game to Previous Monitor", osd_ini, L"Display.Monitor"), - Keybind ( &config.monitors.monitor_toggle_hdr, L"Toggle HDR on Selected Monitor", osd_ini, L"Display.Monitor"), + Keybind (&config.monitors.multimonitor_focus_keybind,L"Toggle Multi-Monitor Focus Mode", osd_ini, L"Display.Monitor"), + Keybind (&config.monitors.monitor_primary_keybind, L"Move Game to Primary Monitor", osd_ini, L"Display.Monitor"), + Keybind (&config.monitors.monitor_next_keybind, L"Move Game to Next Monitor", osd_ini, L"Display.Monitor"), + Keybind (&config.monitors.monitor_prev_keybind, L"Move Game to Previous Monitor", osd_ini, L"Display.Monitor"), + Keybind (&config.monitors.monitor_toggle_hdr, L"Toggle HDR on Selected Monitor", osd_ini, L"Display.Monitor"), Keybind ( &config.render.framerate.latent_sync. tearline_move_down_keybind, L"Move Tear Location Down 1 Scanline", osd_ini, L"LatentSync.Control"), @@ -1911,7 +1912,7 @@ auto DeclKeybind = ConfigEntry (display.force_windowed, L"Force Windowed Mode", dll_ini, L"Display.Output", L"ForceWindowed"), ConfigEntry (display.force_10bpc_sdr, L"Force 10-bpc (SDR) Output", dll_ini, L"Display.Output", L"Force10bpcSDR"), ConfigEntry (display.aspect_ratio_stretch, L"Fill monitor background (eg. black bars) in windowed mode", dll_ini, L"Display.Output", L"AspectRatioStretch"), - ConfigEntry (display.multimonitor_focus_mode, L"Displays black background on all except the game's monitor",dll_ini, L"Display.Output", L"BlackoutSecondaryDisplays"), + ConfigEntry (display.multimonitor_focus_mode, L"Displays black background on all except the game's monitor",dll_ini, L"Display.Output", L"MultiMonitorADHDRelief"), ConfigEntry (display.allow_refresh_change, L"Allow Current Game to change Refresh Rate", dll_ini, L"Display.Output", L"AllowRefreshRateChanges"), @@ -5480,6 +5481,7 @@ auto DeclKeybind = LoadKeybind (&config.monitors.monitor_next_keybind); LoadKeybind (&config.monitors.monitor_prev_keybind); LoadKeybind (&config.monitors.monitor_toggle_hdr); + LoadKeybind (&config.monitors.multimonitor_focus_keybind); LoadKeybind (&config.render.framerate.latent_sync.tearline_move_up_keybind); LoadKeybind (&config.render.framerate.latent_sync.tearline_move_down_keybind); diff --git a/src/control_panel.cpp b/src/control_panel.cpp index 75359f1ea..a9674dfda 100644 --- a/src/control_panel.cpp +++ b/src/control_panel.cpp @@ -2091,7 +2091,7 @@ SK_Display_ResolutionSelectUI (bool bMarkDirty) ImGui::SetItemTooltip ("Some engines may require a game restart to adjust to new aspect ratio."); } - if (ImGui::Checkbox ("Multi-Monitor Sleep", &config.display.focus_mode)) + if (ImGui::Checkbox ("ADHD Multi-Monitor Mode", &config.display.focus_mode)) { if (config.display.focus_mode) { @@ -2100,11 +2100,15 @@ SK_Display_ResolutionSelectUI (bool bMarkDirty) } SK_Win32_BringBackgroundWindowToTop (); - SK_ImGui_AdjustCursor (); config.utility.save_async (); } + ImGui::SetItemTooltip ( + "Covers secondary monitors with a black window to reduce distractions " + "while playing games." + ); + ImGui::EndGroup (); fWhitePointSliderWidth = ImGui::GetItemRectSize ().x; @@ -3209,7 +3213,8 @@ SK_ImGui_ControlPanel (void) &config.monitors.monitor_primary_keybind, &config.monitors.monitor_next_keybind, &config.monitors.monitor_prev_keybind, - &config.monitors.monitor_toggle_hdr + &config.monitors.monitor_toggle_hdr, + &config.monitors.multimonitor_focus_keybind, }; // Keybinds made using a menu option must process their popups here diff --git a/src/widgets/widget.cpp b/src/widgets/widget.cpp index 80c65857a..6a3ae81d5 100644 --- a/src/widgets/widget.cpp +++ b/src/widgets/widget.cpp @@ -948,7 +948,7 @@ SK_ImGui_WidgetRegistry::DispatchKeybinds ( BOOL Control, static - std::array + std::array special_keys = { &config.screenshots.game_hud_free_keybind, &config.screenshots.sk_osd_free_keybind, @@ -961,6 +961,7 @@ SK_ImGui_WidgetRegistry::DispatchKeybinds ( BOOL Control, &config.monitors.monitor_next_keybind, &config.monitors.monitor_prev_keybind, &config.monitors.monitor_toggle_hdr, + &config.monitors.multimonitor_focus_keybind, &config.render.framerate.latent_sync.tearline_move_up_keybind, &config.render.framerate.latent_sync.tearline_move_down_keybind, @@ -1073,6 +1074,17 @@ SK_ImGui_WidgetRegistry::DispatchKeybinds ( BOOL Control, } } + else if ( keybind == &config.monitors.multimonitor_focus_keybind ) + { + config.display.focus_mode = !config.display.focus_mode; + config.window.background_render = true; // Required for this to work reliably + config.window.always_on_top = SmartAlwaysOnTop; // Needed to fix taskbar visibility + + SK_Win32_BringBackgroundWindowToTop (); + + config.utility.save_async (); + } + else if ( keybind == &config.monitors.monitor_primary_keybind ) { const SK_RenderBackend& rb = diff --git a/src/window.cpp b/src/window.cpp index 017fdb69a..37e8118ae 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -868,6 +868,11 @@ class SK_WindowManager : public SK_IVariableListener top_most_ ); + cmd->AddVariable ( + "Display.MultiMonitorFocus", + SK_CreateVar (SK_IVariable::Boolean, &config.display.focus_mode) + ); + borderless_ = SK_CreateVar (SK_IVariable::Boolean, &config.window.borderless, this);