[PT Run] Add setting to use centralized keyboard hook (#13557)

* [PT Run] Add setting to use centralized hook

* Add UI separator
This commit is contained in:
Jaime Bernardo
2021-10-01 14:59:52 +01:00
committed by GitHub
parent 55054f1fa6
commit 84b2ae3e8f
11 changed files with 124 additions and 29 deletions

View File

@@ -48,6 +48,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library
[JsonPropertyName("startupPosition")]
public StartupPosition Position { get; set; }
[JsonPropertyName("use_centralized_keyboard_hook")]
public bool UseCentralizedKeyboardHook { get; set; }
public PowerLauncherProperties()
{
OpenPowerLauncher = new HotkeySettings(false, false, true, false, 32);
@@ -61,6 +64,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
MaximumNumberOfResults = 4;
Theme = Theme.System;
Position = StartupPosition.Cursor;
UseCentralizedKeyboardHook = false;
}
}
}

View File

@@ -275,6 +275,23 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
}
}
public bool UseCentralizedKeyboardHook
{
get
{
return settings.Properties.UseCentralizedKeyboardHook;
}
set
{
if (settings.Properties.UseCentralizedKeyboardHook != value)
{
settings.Properties.UseCentralizedKeyboardHook = value;
UpdateSettings();
}
}
}
public HotkeySettings OpenFileLocation
{
get

View File

@@ -401,6 +401,9 @@
<data name="PowerLauncher_IgnoreHotkeysInFullScreen.Content" xml:space="preserve">
<value>Ignore shortcuts in fullscreen mode</value>
</data>
<data name="PowerLauncher_UseCentralizedKeyboardHook.Content" xml:space="preserve">
<value>Use centralized keyboard hook (try it if there are issues with the shortcut)</value>
</data>
<data name="PowerLauncher_ClearInputOnLaunch.Content" xml:space="preserve">
<value>Clear the previous query on launch</value>
</data>

View File

@@ -45,6 +45,8 @@
</controls:SettingExpander.Header>
<controls:SettingExpander.Content>
<StackPanel>
<CheckBox x:Uid="PowerLauncher_UseCentralizedKeyboardHook" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.UseCentralizedKeyboardHook}" Margin="{StaticResource ExpanderSettingMargin}" />
<Rectangle Style="{StaticResource ExpanderSeparatorStyle}" />
<CheckBox x:Uid="PowerLauncher_IgnoreHotkeysInFullScreen" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.IgnoreHotkeysInFullScreen}" Margin="{StaticResource ExpanderSettingMargin}" />
</StackPanel>
</controls:SettingExpander.Content>