[FindMyMouse]Add more shake sensitivity settings (#30829)

This commit is contained in:
Jaime Bernardo
2024-01-16 17:35:54 +00:00
committed by GitHub
parent 6cd8753fe0
commit daafbe5432
7 changed files with 134 additions and 6 deletions

View File

@@ -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=&#xEDA7;}"

View File

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

View File

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