mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
[PTRun]Add setting to disable input delay (#18724)
* [PTRun]Add setting to disable input delay * Address feedback and allow configuring delay * Address PR feedback
This commit is contained in:
@@ -51,6 +51,12 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
[JsonPropertyName("use_centralized_keyboard_hook")]
|
||||
public bool UseCentralizedKeyboardHook { get; set; }
|
||||
|
||||
[JsonPropertyName("search_query_results_with_delay")]
|
||||
public bool SearchQueryResultsWithDelay { get; set; }
|
||||
|
||||
[JsonPropertyName("search_input_delay")]
|
||||
public int SearchInputDelay { get; set; }
|
||||
|
||||
public PowerLauncherProperties()
|
||||
{
|
||||
OpenPowerLauncher = new HotkeySettings(false, false, true, false, 32);
|
||||
@@ -65,6 +71,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
Theme = Theme.System;
|
||||
Position = StartupPosition.Cursor;
|
||||
UseCentralizedKeyboardHook = false;
|
||||
SearchQueryResultsWithDelay = true;
|
||||
SearchInputDelay = 150;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,6 +296,40 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool SearchQueryResultsWithDelay
|
||||
{
|
||||
get
|
||||
{
|
||||
return settings.Properties.SearchQueryResultsWithDelay;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (settings.Properties.SearchQueryResultsWithDelay != value)
|
||||
{
|
||||
settings.Properties.SearchQueryResultsWithDelay = value;
|
||||
UpdateSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int SearchInputDelay
|
||||
{
|
||||
get
|
||||
{
|
||||
return settings.Properties.SearchInputDelay;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (settings.Properties.SearchInputDelay != value)
|
||||
{
|
||||
settings.Properties.SearchInputDelay = value;
|
||||
UpdateSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public HotkeySettings OpenFileLocation
|
||||
{
|
||||
get
|
||||
|
||||
@@ -414,6 +414,17 @@
|
||||
<data name="PowerLauncher_ClearInputOnLaunch.Content" xml:space="preserve">
|
||||
<value>Clear the previous query on launch</value>
|
||||
</data>
|
||||
<data name="PowerLauncher_SearchQueryResultsWithDelay.Header" xml:space="preserve">
|
||||
<value>Delay search</value>
|
||||
<comment>This is about adding a delay to wait for more input before executing a search</comment>
|
||||
</data>
|
||||
<data name="PowerLauncher_SearchQueryResultsWithDelay.Description" xml:space="preserve">
|
||||
<value>Add a delay to wait for more input before executing a search</value>
|
||||
</data>
|
||||
<data name="PowerLauncher_SearchInputDelayMs.Header" xml:space="preserve">
|
||||
<value>Search delay (ms)</value>
|
||||
<comment>ms = milliseconds</comment>
|
||||
</data>
|
||||
<data name="KeyboardManager_KeysMappingLayoutRightHeader.Text" xml:space="preserve">
|
||||
<value>To:</value>
|
||||
<comment>Keyboard Manager mapping keys view right header</comment>
|
||||
|
||||
@@ -94,6 +94,29 @@
|
||||
|
||||
|
||||
<controls:SettingsGroup x:Uid="PowerLauncher_SearchResults" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}">
|
||||
<controls:SettingExpander IsExpanded="True">
|
||||
<controls:SettingExpander.Header>
|
||||
<controls:Setting x:Uid="PowerLauncher_SearchQueryResultsWithDelay" Icon="" Style="{StaticResource ExpanderHeaderSettingStyle}" >
|
||||
<controls:Setting.ActionContent>
|
||||
<ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.SearchQueryResultsWithDelay}"/>
|
||||
</controls:Setting.ActionContent>
|
||||
</controls:Setting>
|
||||
</controls:SettingExpander.Header>
|
||||
<controls:SettingExpander.Content>
|
||||
<controls:Setting x:Uid="PowerLauncher_SearchInputDelayMs" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.SearchQueryResultsWithDelay}" Style="{StaticResource ExpanderContentSettingStyle}">
|
||||
<controls:Setting.ActionContent>
|
||||
<muxc:NumberBox Minimum="0"
|
||||
Maximum="1000"
|
||||
Value="{x:Bind Mode=TwoWay, Path=ViewModel.SearchInputDelay}"
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
HorizontalAlignment="Left"
|
||||
SmallChange="10"
|
||||
LargeChange="50"/>
|
||||
</controls:Setting.ActionContent>
|
||||
</controls:Setting>
|
||||
</controls:SettingExpander.Content>
|
||||
</controls:SettingExpander>
|
||||
<controls:SettingExpander IsExpanded="True">
|
||||
<controls:SettingExpander.Header>
|
||||
<controls:Setting x:Uid="PowerLauncher_MaximumNumberOfResults" Icon="" Style="{StaticResource ExpanderHeaderSettingStyle}">
|
||||
|
||||
Reference in New Issue
Block a user