Compare commits

...

1 Commits

Author SHA1 Message Date
qhy040404
f66ad3b4e1 fix #1632 2024-05-23 11:29:39 +08:00
3 changed files with 8 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

@@ -2664,7 +2664,7 @@
<value>高级功能</value>
</data>
<data name="ViewPageSettingKeyShortcutAutoClickingDescription" xml:space="preserve">
<value>更改自动连点功能的快捷键</value>
<value>更改自动连点功能的快捷键,仅管理员模式下生效</value>
</data>
<data name="ViewPageSettingKeyShortcutAutoClickingHeader" xml:space="preserve">
<value>自动连点</value>
@@ -3257,4 +3257,4 @@
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
<value>显示器编号</value>
</data>
</root>
</root>

View File

@@ -437,7 +437,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 +447,7 @@
MinWidth="64"
VerticalAlignment="Center"
Content="Win"
IsChecked="{Binding HotKeyOptions.MouseClickRepeatForeverKeyCombination.ModifierHasWindows, Mode=TwoWay}"/>
IsEnabled="False"/>
<CheckBox
MinWidth="64"
VerticalAlignment="Center"