Skip to content

Commit cf9a7a9

Browse files
committed
Add setting to management console
1 parent d09183b commit cf9a7a9

File tree

4 files changed

+60
-10
lines changed

4 files changed

+60
-10
lines changed

src/JuliusSweetland.OptiKey.Core/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/JuliusSweetland.OptiKey.Core/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,4 +2476,7 @@ Magyar
24762476
<data name="ERROR_ACCESSING_CLIPBOARD" xml:space="preserve">
24772477
<value>The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.</value>
24782478
</data>
2479+
<data name="ALLOW_REPEATS_LABEL" xml:space="preserve">
2480+
<value>Allow key actions to be repeated when pressing trigger away from keyboard</value>
2481+
</data>
24792482
</root>

src/JuliusSweetland.OptiKey.Core/UI/ViewModels/Management/PointingAndSelectingViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@ public List<KeyValuePair<string, ProgressIndicatorBehaviours>> ProgressIndicator
238238
}
239239
}
240240

241+
private bool allowRepeats;
242+
public bool AllowRepeats
243+
{
244+
get { return allowRepeats; }
245+
set { SetProperty(ref allowRepeats, value); }
246+
}
247+
241248
private PointsSources pointSource;
242249
public PointsSources PointsSource
243250
{
@@ -560,6 +567,7 @@ public bool ChangesRequireRestart
560567

561568
private void Load()
562569
{
570+
AllowRepeats = Settings.Default.AllowRepeatKeyActionsAwayFromKey;
563571
PointsSource = Settings.Default.PointsSource;
564572
TobiiEyeXProcessingLevel = Settings.Default.TobiiEyeXProcessingLevel;
565573
IrisbondProcessingLevel = Settings.Default.IrisbondProcessingLevel;
@@ -598,10 +606,12 @@ private void Load()
598606
MultiKeySelectionTriggerStopSignal = Settings.Default.MultiKeySelectionTriggerStopSignal;
599607
MultiKeySelectionFixationMinDwellTimeInMs = Settings.Default.MultiKeySelectionFixationMinDwellTime.TotalMilliseconds;
600608
MultiKeySelectionMaxDurationInMs = Settings.Default.MultiKeySelectionMaxDuration.TotalMilliseconds;
609+
601610
}
602611

603612
public void ApplyChanges()
604613
{
614+
Settings.Default.AllowRepeatKeyActionsAwayFromKey = AllowRepeats;
605615
Settings.Default.PointsSource = PointsSource;
606616
Settings.Default.TobiiEyeXProcessingLevel = TobiiEyeXProcessingLevel;
607617
Settings.Default.IrisbondProcessingLevel = IrisbondProcessingLevel;

src/JuliusSweetland.OptiKey.Core/UI/Views/Management/PointingAndSelectingView.xaml

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ Copyright (c) 2022 OPTIKEY LTD (UK company number 11854839) - All Rights Reserve
649649
</ComboBox>
650650

651651

652-
<TextBlock Grid.Row="7" Grid.Column="0" Text="{x:Static resx:Resources.KEY_SELECTION_GAMEPAD_SLOT_LABEL}"
652+
<TextBlock Grid.Row="6" Grid.Column="0" Text="{x:Static resx:Resources.KEY_SELECTION_GAMEPAD_SLOT_LABEL}"
653653
VerticalAlignment="Center" Margin="5">
654654
<TextBlock.Style>
655655
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
@@ -662,7 +662,7 @@ Copyright (c) 2022 OPTIKEY LTD (UK company number 11854839) - All Rights Reserve
662662
</Style>
663663
</TextBlock.Style>
664664
</TextBlock>
665-
<ComboBox Grid.Row="7" Grid.Column="1"
665+
<ComboBox Grid.Row="6" Grid.Column="1"
666666
ItemsSource="{Binding XInputSlots}"
667667
DisplayMemberPath="Key"
668668
SelectedValuePath="Value"
@@ -679,7 +679,7 @@ Copyright (c) 2022 OPTIKEY LTD (UK company number 11854839) - All Rights Reserve
679679
</ComboBox.Style>
680680
</ComboBox>
681681

682-
<TextBlock Grid.Row="8" Grid.Column="0" Text="{x:Static resx:Resources.KEY_SELECTION_GAMEPAD_BUTTON_LABEL}"
682+
<TextBlock Grid.Row="7" Grid.Column="0" Text="{x:Static resx:Resources.KEY_SELECTION_GAMEPAD_BUTTON_LABEL}"
683683
VerticalAlignment="Center" Margin="5">
684684
<TextBlock.Style>
685685
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
@@ -692,7 +692,7 @@ Copyright (c) 2022 OPTIKEY LTD (UK company number 11854839) - All Rights Reserve
692692
</Style>
693693
</TextBlock.Style>
694694
</TextBlock>
695-
<ComboBox Grid.Row="8" Grid.Column="1"
695+
<ComboBox Grid.Row="7" Grid.Column="1"
696696
ItemsSource="{Binding GamepadButtonFlags}"
697697
SelectedValue="{Binding KeySelectionTriggerGamepadXInputButtonDownUpButton, Mode=TwoWay}">
698698
<ComboBox.Style>
@@ -707,7 +707,7 @@ Copyright (c) 2022 OPTIKEY LTD (UK company number 11854839) - All Rights Reserve
707707
</ComboBox.Style>
708708
</ComboBox>
709709

710-
<TextBlock Grid.Row="7" Grid.Column="0" Text="{x:Static resx:Resources.KEY_SELECTION_GAMEPAD_CONTROLLER_LABEL}"
710+
<TextBlock Grid.Row="6" Grid.Column="0" Text="{x:Static resx:Resources.KEY_SELECTION_GAMEPAD_CONTROLLER_LABEL}"
711711
VerticalAlignment="Center" Margin="5">
712712
<TextBlock.Style>
713713
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
@@ -720,7 +720,7 @@ Copyright (c) 2022 OPTIKEY LTD (UK company number 11854839) - All Rights Reserve
720720
</Style>
721721
</TextBlock.Style>
722722
</TextBlock>
723-
<ComboBox Grid.Row="7" Grid.Column="1"
723+
<ComboBox Grid.Row="6" Grid.Column="1"
724724
ItemsSource="{Binding DirectInputControllers}"
725725
DisplayMemberPath="Value"
726726
SelectedValuePath="Key"
@@ -737,7 +737,7 @@ Copyright (c) 2022 OPTIKEY LTD (UK company number 11854839) - All Rights Reserve
737737
</ComboBox.Style>
738738
</ComboBox>
739739

740-
<TextBlock Grid.Row="8" Grid.Column="0" Text="{x:Static resx:Resources.KEY_SELECTION_GAMEPAD_BUTTON_LABEL}"
740+
<TextBlock Grid.Row="7" Grid.Column="0" Text="{x:Static resx:Resources.KEY_SELECTION_GAMEPAD_BUTTON_LABEL}"
741741
VerticalAlignment="Center" Margin="5">
742742
<TextBlock.Style>
743743
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
@@ -750,7 +750,7 @@ Copyright (c) 2022 OPTIKEY LTD (UK company number 11854839) - All Rights Reserve
750750
</Style>
751751
</TextBlock.Style>
752752
</TextBlock>
753-
<controls:NumericUpDown Grid.Row="8" Grid.Column="1" TextAlignment="Left"
753+
<controls:NumericUpDown Grid.Row="7" Grid.Column="1" TextAlignment="Left"
754754
Minimum="1" Maximum="128" Interval="1" StringFormat="###,##0"
755755
Value="{Binding KeySelectionTriggerGamepadDirectInputButtonDownUpButton, Mode=TwoWay}">
756756
<controls:NumericUpDown.Style>
@@ -765,7 +765,35 @@ Copyright (c) 2022 OPTIKEY LTD (UK company number 11854839) - All Rights Reserve
765765
</controls:NumericUpDown.Style>
766766
</controls:NumericUpDown>
767767

768-
<TextBlock Grid.Row="7" Grid.Column="0" Text="{x:Static resx:Resources.KEY_SELECTION_MOUSE_BUTTON_LABEL}"
768+
<TextBlock Grid.Row="8" Grid.Column="0" Text="{x:Static resx:Resources.ALLOW_REPEATS_LABEL}"
769+
VerticalAlignment="Center" Margin="5" >
770+
<TextBlock.Style>
771+
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
772+
<Setter Property="Visibility" Value="Visible" />
773+
<Style.Triggers>
774+
<DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
775+
<Setter Property="Visibility" Value="Collapsed" />
776+
</DataTrigger>
777+
</Style.Triggers>
778+
</Style>
779+
</TextBlock.Style>
780+
</TextBlock>
781+
<CheckBox Grid.Row="8" Grid.Column="1"
782+
VerticalAlignment="Center"
783+
IsChecked="{Binding AllowRepeats, Mode=TwoWay}" >
784+
<CheckBox.Style>
785+
<Style TargetType="{x:Type CheckBox}" BasedOn="{StaticResource {x:Type CheckBox}}">
786+
<Setter Property="Visibility" Value="Visible" />
787+
<Style.Triggers>
788+
<DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
789+
<Setter Property="Visibility" Value="Collapsed" />
790+
</DataTrigger>
791+
</Style.Triggers>
792+
</Style>
793+
</CheckBox.Style>
794+
</CheckBox>
795+
796+
<TextBlock Grid.Row="6" Grid.Column="0" Text="{x:Static resx:Resources.KEY_SELECTION_MOUSE_BUTTON_LABEL}"
769797
VerticalAlignment="Center" Margin="5">
770798
<TextBlock.Style>
771799
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
@@ -778,7 +806,7 @@ Copyright (c) 2022 OPTIKEY LTD (UK company number 11854839) - All Rights Reserve
778806
</Style>
779807
</TextBlock.Style>
780808
</TextBlock>
781-
<ComboBox Grid.Row="8" Grid.Column="1"
809+
<ComboBox Grid.Row="6" Grid.Column="1"
782810
ItemsSource="{Binding MouseButtons}"
783811
SelectedValue="{Binding KeySelectionTriggerMouseDownUpButton, Mode=TwoWay}">
784812
<ComboBox.Style>

0 commit comments

Comments
 (0)