From 7c7ccc3a07c22892c8fbdad2b0a655e5bbd63249 Mon Sep 17 00:00:00 2001 From: smiley Date: Thu, 4 Jun 2020 20:21:16 +0300 Subject: [PATCH] [PowerToys Run] Add "ignore hotkeys in fullscreen" setting (#3262) (#3604) Connect Wox's existing "ignore hotkeys in fullscreen mode" setting to PowerLauncher and the PowerToys settings UI. This allows PowerLauncher to ignore hotkeys if any application is currently in fullscreen mode, whether it's real exclusive fullscreen or borderless windowed mode. This applies to things like fullscreen games, video and presentations but not maximized windows. --- .../PowerLauncherProperties.cs | 3 +++ .../Strings/en-us/Resources.resw | 3 +++ .../ViewModels/PowerLauncherViewModel.cs | 17 +++++++++++++++++ .../Views/PowerLauncherPage.xaml | 6 ++++++ .../launcher/PowerLauncher/SettingsWatcher.cs | 5 +++++ 5 files changed, 34 insertions(+) diff --git a/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherProperties.cs b/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherProperties.cs index 5f61705afb..f4ef1b8e6c 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherProperties.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI.Lib/PowerLauncherProperties.cs @@ -24,6 +24,8 @@ namespace Microsoft.PowerToys.Settings.UI.Lib public bool override_win_s_key { get; set; } + public bool ignore_hotkeys_in_fullscreen { get; set; } + public PowerLauncherProperties() { open_powerlauncher = new HotkeySettings(); @@ -32,6 +34,7 @@ namespace Microsoft.PowerToys.Settings.UI.Lib open_console = new HotkeySettings(); search_result_preference = "most_recently_used"; search_type_preference = "application_name"; + ignore_hotkeys_in_fullscreen = false; } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw b/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw index b558900aa6..276b345dde 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw +++ b/src/core/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw @@ -250,6 +250,9 @@ Override Win+S key + + Ignore hotkeys in fullscreen mode + To: Keyboard Manager mapping keys view right header diff --git a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs index fe218ef302..268fa5ca0e 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs +++ b/src/core/Microsoft.PowerToys.Settings.UI/ViewModels/PowerLauncherViewModel.cs @@ -235,5 +235,22 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels } } } + + public bool IgnoreHotkeysInFullScreen + { + get + { + return settings.properties.ignore_hotkeys_in_fullscreen; + } + + set + { + if (settings.properties.ignore_hotkeys_in_fullscreen != value) + { + settings.properties.ignore_hotkeys_in_fullscreen = value; + UpdateSettings(); + } + } + } } } diff --git a/src/core/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml b/src/core/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml index e8580c731c..30eb2324dd 100644 --- a/src/core/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml +++ b/src/core/Microsoft.PowerToys.Settings.UI/Views/PowerLauncherPage.xaml @@ -128,6 +128,12 @@ IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.OverrideWinSKey}" IsEnabled="False" />--> + +