Merge pull request #1636 from DGP-Studio/fix/1632

fix #1632
This commit is contained in:
DismissedLight
2024-05-23 20:14:47 +08:00
committed by GitHub
3 changed files with 10 additions and 33 deletions

View File

@@ -27,7 +27,6 @@ internal sealed class HotKeyCombination : ObservableObject
private bool registered;
private bool modifierHasWindows;
private bool modifierHasControl;
private bool modifierHasShift;
private bool modifierHasAlt;
@@ -52,7 +51,10 @@ internal sealed class HotKeyCombination : ObservableObject
isEnabled = LocalSetting.Get($"{settingKey}.IsEnabled", true);
HotKeyParameter actual = LocalSettingGetHotKeyParameter();
modifiers = actual.Modifiers;
// HOT_KEY_MODIFIERS.MOD_WIN is reversed for use by the OS.
// It should not be used by the application.
modifiers = actual.Modifiers & ~HOT_KEY_MODIFIERS.MOD_WIN;
InitializeModifiersCompositionFields();
key = actual.Key;
@@ -61,18 +63,6 @@ internal sealed class HotKeyCombination : ObservableObject
}
#region Binding Property
public bool ModifierHasWindows
{
get => modifierHasWindows;
set
{
if (SetProperty(ref modifierHasWindows, value))
{
UpdateModifiers();
}
}
}
public bool ModifierHasControl
{
get => modifierHasControl;
@@ -218,11 +208,6 @@ internal sealed class HotKeyCombination : ObservableObject
{
StringBuilder stringBuilder = new();
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_WIN))
{
stringBuilder.Append("Win").Append(" + ");
}
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_CONTROL))
{
stringBuilder.Append("Ctrl").Append(" + ");
@@ -247,11 +232,6 @@ internal sealed class HotKeyCombination : ObservableObject
{
HOT_KEY_MODIFIERS modifiers = default;
if (ModifierHasWindows)
{
modifiers |= HOT_KEY_MODIFIERS.MOD_WIN;
}
if (ModifierHasControl)
{
modifiers |= HOT_KEY_MODIFIERS.MOD_CONTROL;
@@ -272,11 +252,6 @@ internal sealed class HotKeyCombination : ObservableObject
private void InitializeModifiersCompositionFields()
{
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_WIN))
{
modifierHasWindows = true;
}
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_CONTROL))
{
modifierHasControl = true;

View File

@@ -2667,7 +2667,7 @@
<value>高级功能</value>
</data>
<data name="ViewPageSettingKeyShortcutAutoClickingDescription" xml:space="preserve">
<value>更改自动连点功能的快捷键</value>
<value>更改自动连点功能的快捷键,仅管理员模式下生效</value>
</data>
<data name="ViewPageSettingKeyShortcutAutoClickingHeader" xml:space="preserve">
<value>自动连点</value>

View File

@@ -426,8 +426,10 @@
<cwc:SettingsCard
Description="{shcm:ResourceString Name=ViewPageSettingKeyShortcutAutoClickingDescription}"
Header="{shcm:ResourceString Name=ViewPageSettingKeyShortcutAutoClickingHeader}"
HeaderIcon="{shcm:FontIcon Glyph=&#xE92E;}">
HeaderIcon="{shcm:FontIcon Glyph=&#xE92E;}"
IsEnabled="{Binding RuntimeOptions.IsElevated}">
<StackPanel Orientation="Horizontal" Spacing="8">
<shvc:Elevation Margin="0,0,16,0" Visibility="{Binding RuntimeOptions.IsElevated, Converter={StaticResource BoolToVisibilityRevertConverter}}"/>
<Button
MinWidth="32"
MinHeight="32"
@@ -437,7 +439,7 @@
FontFamily="{ThemeResource SymbolThemeFontFamily}"
Style="{ThemeResource SettingButtonStyle}">
<Button.Flyout>
<Flyout FlyoutPresenterStyle="{ThemeResource FlyoutPresenterPadding16And10Style}">
<Flyout FlyoutPresenterStyle="{ThemeResource FlyoutPresenterPadding16And10Style}" ShouldConstrainToRootBounds="False">
<cwc:UniformGrid
ColumnSpacing="16"
Columns="2"
@@ -447,7 +449,7 @@
MinWidth="64"
VerticalAlignment="Center"
Content="Win"
IsChecked="{Binding HotKeyOptions.MouseClickRepeatForeverKeyCombination.ModifierHasWindows, Mode=TwoWay}"/>
IsEnabled="False"/>
<CheckBox
MinWidth="64"
VerticalAlignment="Center"