[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.
This commit is contained in:
smiley
2020-06-04 20:21:16 +03:00
committed by GitHub
parent fb3f4fa0a8
commit 7c7ccc3a07
5 changed files with 34 additions and 0 deletions

View File

@@ -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;
}
}
}

View File

@@ -250,6 +250,9 @@
<data name="PowerLauncher_OverrideWinSKey.Content" xml:space="preserve">
<value>Override Win+S key</value>
</data>
<data name="PowerLauncher_IgnoreHotkeysInFullScreen.Content" xml:space="preserve">
<value>Ignore hotkeys in fullscreen mode</value>
</data>
<data name="KeyboardManager_KeysMappingLayoutRightHeader.Text" xml:space="preserve">
<value>To:</value>
<comment>Keyboard Manager mapping keys view right header</comment>

View File

@@ -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();
}
}
}
}
}

View File

@@ -128,6 +128,12 @@
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.OverrideWinSKey}"
IsEnabled="False"
/>-->
<CheckBox x:Uid="PowerLauncher_IgnoreHotkeysInFullScreen"
Margin="{StaticResource SmallTopMargin}"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.IgnoreHotkeysInFullScreen}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
/>
</StackPanel>
<StackPanel
x:Name="SidePanel"

View File

@@ -66,6 +66,11 @@ namespace PowerLauncher
{
_settings.MaxResultsToShow = overloadSettings.properties.maximum_number_of_results;
}
if (_settings.IgnoreHotkeysOnFullscreen != overloadSettings.properties.ignore_hotkeys_in_fullscreen)
{
_settings.IgnoreHotkeysOnFullscreen = overloadSettings.properties.ignore_hotkeys_in_fullscreen;
}
}
catch (Exception e)
{