[Shortcut Guide] Activate with Windows key press (#13342)

* [Shortcut Guide] Activate with Windows key press

* fix spellchecker

* pr comments: fix search and add lock

* Add activation method combo box

* fix spellchecker issue for customized

* Standardize centralized hotkeys file names

* Add warning when using the long win key method

* Address PR feedback on text

* More PR feedback
This commit is contained in:
Jaime Bernardo
2021-09-23 14:23:22 +01:00
committed by GitHub
parent a0ebe5ed54
commit f647223e94
15 changed files with 308 additions and 20 deletions

View File

@@ -615,6 +615,24 @@
<value>Press duration before showing (ms)</value>
<comment>pressing a key in milliseconds</comment>
</data>
<data name="ShortcutGuide_PressTime.Description" xml:space="preserve">
<value>How long to press the Windows key to activate the module</value>
</data>
<data name="ShortcutGuide_ActivationMethod.Header" xml:space="preserve">
<value>Activation method</value>
</data>
<data name="ShortcutGuide_ActivationMethod.Description" xml:space="preserve">
<value>Use a shortcut or press the Windows key for some time to activate</value>
</data>
<data name="Radio_ShortcutGuide_ActivationMethod_CustomizedShortcut.Content" xml:space="preserve">
<value>Customized shortcut</value>
</data>
<data name="Radio_ShortcutGuide_ActivationMethod_LongPressWindowsKey.Content" xml:space="preserve">
<value>Hold down Windows key</value>
</data>
<data name="ShortcutGuide_PressWinKeyWarning.Title" xml:space="preserve">
<value>In some edge cases Shortcut Guide might not function correctly when using this activation method</value>
</data>
<data name="ShortcutGuide_Appearance_Behavior.Header" xml:space="preserve">
<value>Appearance &amp; behavior</value>
</data>

View File

@@ -12,6 +12,9 @@
<Page.Resources>
<converters:StringFormatConverter x:Key="StringFormatConverter"/>
<converters:BoolToObjectConverter x:Key="BoolToComboBoxIndexConverter" TrueValue="1" FalseValue="0"/>
<converters:BoolToVisibilityConverter x:Key="TrueToVisibleConverter" TrueValue="Visible" FalseValue="Collapsed"/>
<converters:BoolToVisibilityConverter x:Key="FalseToVisibleConverter" TrueValue="Collapsed" FalseValue="Visible"/>
</Page.Resources>
<controls:SettingsPageControl x:Uid="ShortcutGuide"
@@ -29,12 +32,43 @@
<controls:SettingsGroup x:Uid="Shortcut" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<controls:Setting x:Uid="Activation_Shortcut" Icon="&#xEDA7;" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<controls:Setting x:Uid="ShortcutGuide_ActivationMethod">
<controls:Setting.ActionContent>
<ComboBox SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.UseLegacyPressWinKeyBehavior, Converter={StaticResource BoolToComboBoxIndexConverter}}" MinWidth="{StaticResource SettingActionControlMinWidth}">
<ComboBoxItem x:Uid="Radio_ShortcutGuide_ActivationMethod_CustomizedShortcut"/>
<ComboBoxItem x:Uid="Radio_ShortcutGuide_ActivationMethod_LongPressWindowsKey"/>
</ComboBox>
</controls:Setting.ActionContent>
</controls:Setting>
<controls:Setting x:Uid="Activation_Shortcut" Icon="&#xEDA7;" Visibility="{x:Bind Mode=OneWay, Path=ViewModel.UseLegacyPressWinKeyBehavior, Converter={StaticResource FalseToVisibleConverter}}">
<controls:Setting.ActionContent>
<controls:ShortcutControl HotkeySettings="{x:Bind Path=ViewModel.OpenShortcutGuide, Mode=TwoWay}"
MinWidth="{StaticResource SettingActionControlMinWidth}"/>
</controls:Setting.ActionContent>
</controls:Setting>
<controls:Setting x:Uid="ShortcutGuide_PressTime" Icon="&#xE916;" Visibility="{x:Bind Mode=OneWay, Path=ViewModel.UseLegacyPressWinKeyBehavior, Converter={StaticResource TrueToVisibleConverter}}">
<controls:Setting.ActionContent>
<muxc:NumberBox
Minimum="100"
Value="{x:Bind Mode=TwoWay, Path=ViewModel.PressTime}"
MinWidth="{StaticResource SettingActionControlMinWidth}"
SpinButtonPlacementMode="Compact"
HorizontalAlignment="Left"
SmallChange="50"
LargeChange="100"
/>
</controls:Setting.ActionContent>
</controls:Setting>
<muxc:InfoBar
x:Uid="ShortcutGuide_PressWinKeyWarning"
Severity="Warning"
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.UseLegacyPressWinKeyBehavior}"
IsClosable="False"
/>
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="ShortcutGuide_Appearance_Behavior" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">