mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[FindMyMouse]Add more shake sensitivity settings (#30829)
This commit is contained in:
@@ -43,6 +43,12 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
[JsonPropertyName("shaking_minimum_distance")]
|
||||
public IntProperty ShakingMinimumDistance { get; set; }
|
||||
|
||||
[JsonPropertyName("shaking_interval_ms")]
|
||||
public IntProperty ShakingIntervalMs { get; set; }
|
||||
|
||||
[JsonPropertyName("shaking_factor")]
|
||||
public IntProperty ShakingFactor { get; set; }
|
||||
|
||||
public FindMyMouseProperties()
|
||||
{
|
||||
ActivationMethod = new IntProperty(0);
|
||||
@@ -56,6 +62,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
SpotlightInitialZoom = new IntProperty(9);
|
||||
ExcludedApps = new StringProperty();
|
||||
ShakingMinimumDistance = new IntProperty(1000);
|
||||
ShakingIntervalMs = new IntProperty(1000);
|
||||
ShakingFactor = new IntProperty(400);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,26 @@
|
||||
SpinButtonPlacementMode="Compact"
|
||||
Value="{x:Bind ViewModel.FindMyMouseShakingMinimumDistance, Mode=TwoWay}" />
|
||||
</tkcontrols:SettingsCard>
|
||||
<tkcontrols:SettingsCard x:Uid="MouseUtils_FindMyMouse_ShakingIntervalMs" Visibility="{x:Bind ViewModel.FindMyMouseActivationMethod, Converter={StaticResource FindMyMouseActivationIntToVisibilityConverter}, Mode=OneWay, ConverterParameter=2}">
|
||||
<NumberBox
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
LargeChange="1000"
|
||||
Maximum="10000"
|
||||
Minimum="100"
|
||||
SmallChange="100"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
Value="{x:Bind ViewModel.FindMyMouseShakingIntervalMs, Mode=TwoWay}" />
|
||||
</tkcontrols:SettingsCard>
|
||||
<tkcontrols:SettingsCard x:Uid="MouseUtils_FindMyMouse_ShakingFactor" Visibility="{x:Bind ViewModel.FindMyMouseActivationMethod, Converter={StaticResource FindMyMouseActivationIntToVisibilityConverter}, Mode=OneWay, ConverterParameter=2}">
|
||||
<NumberBox
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
LargeChange="100"
|
||||
Maximum="10000"
|
||||
Minimum="150"
|
||||
SmallChange="10"
|
||||
SpinButtonPlacementMode="Compact"
|
||||
Value="{x:Bind ViewModel.FindMyMouseShakingFactor, Mode=TwoWay}" />
|
||||
</tkcontrols:SettingsCard>
|
||||
<tkcontrols:SettingsCard
|
||||
x:Uid="MouseUtils_FindMyMouse_ActivationShortcut"
|
||||
HeaderIcon="{ui:FontIcon Glyph=}"
|
||||
|
||||
@@ -2647,6 +2647,19 @@ Right-click to remove the key combination, thereby deactivating the shortcut.</v
|
||||
<data name="MouseUtils_FindMyMouse_ShakingMinimumDistance.Description" xml:space="preserve">
|
||||
<value>The minimum distance for mouse shaking activation, for adjusting sensitivity</value>
|
||||
</data>
|
||||
<data name="MouseUtils_FindMyMouse_ShakingIntervalMs.Header" xml:space="preserve">
|
||||
<value>Shake Interval (ms)</value>
|
||||
<comment>ms = milliseconds</comment>
|
||||
</data>
|
||||
<data name="MouseUtils_FindMyMouse_ShakingIntervalMs.Description" xml:space="preserve">
|
||||
<value>The span of time during which we track mouse movement to detect shaking, for adjusting sensitivity</value>
|
||||
</data>
|
||||
<data name="MouseUtils_FindMyMouse_ShakingFactor.Header" xml:space="preserve">
|
||||
<value>Shake factor (percent)</value>
|
||||
</data>
|
||||
<data name="MouseUtils_FindMyMouse_ShakingFactor.Description" xml:space="preserve">
|
||||
<value>Mouse shaking is detected by checking how much the mouse pointer has travelled when compared to the diagonal of the movement area. Reducing this factor increases sensitivity.</value>
|
||||
</data>
|
||||
<data name="MouseUtils_MouseHighlighter.Header" xml:space="preserve">
|
||||
<value>Mouse Highlighter</value>
|
||||
<comment>Refers to the utility name</comment>
|
||||
|
||||
@@ -58,6 +58,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
_findMyMouseSpotlightInitialZoom = FindMyMouseSettingsConfig.Properties.SpotlightInitialZoom.Value;
|
||||
_findMyMouseExcludedApps = FindMyMouseSettingsConfig.Properties.ExcludedApps.Value;
|
||||
_findMyMouseShakingMinimumDistance = FindMyMouseSettingsConfig.Properties.ShakingMinimumDistance.Value;
|
||||
_findMyMouseShakingIntervalMs = FindMyMouseSettingsConfig.Properties.ShakingIntervalMs.Value;
|
||||
_findMyMouseShakingFactor = FindMyMouseSettingsConfig.Properties.ShakingFactor.Value;
|
||||
|
||||
ArgumentNullException.ThrowIfNull(mouseHighlighterSettingsRepository);
|
||||
|
||||
@@ -402,6 +404,42 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public int FindMyMouseShakingIntervalMs
|
||||
{
|
||||
get
|
||||
{
|
||||
return _findMyMouseShakingIntervalMs;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != _findMyMouseShakingIntervalMs)
|
||||
{
|
||||
_findMyMouseShakingIntervalMs = value;
|
||||
FindMyMouseSettingsConfig.Properties.ShakingIntervalMs.Value = value;
|
||||
NotifyFindMyMousePropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int FindMyMouseShakingFactor
|
||||
{
|
||||
get
|
||||
{
|
||||
return _findMyMouseShakingFactor;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != _findMyMouseShakingFactor)
|
||||
{
|
||||
_findMyMouseShakingFactor = value;
|
||||
FindMyMouseSettingsConfig.Properties.ShakingFactor.Value = value;
|
||||
NotifyFindMyMousePropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void NotifyFindMyMousePropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
OnPropertyChanged(propertyName);
|
||||
@@ -944,6 +982,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
private int _findMyMouseSpotlightInitialZoom;
|
||||
private string _findMyMouseExcludedApps;
|
||||
private int _findMyMouseShakingMinimumDistance;
|
||||
private int _findMyMouseShakingIntervalMs;
|
||||
private int _findMyMouseShakingFactor;
|
||||
|
||||
private GpoRuleConfigured _highlighterEnabledGpoRuleConfiguration;
|
||||
private bool _highlighterEnabledStateIsGPOConfigured;
|
||||
|
||||
Reference in New Issue
Block a user