2020-07-18 02:01:46 +08:00
|
|
|
<Page
|
|
|
|
x:Class="Microsoft.PowerToys.Settings.UI.Views.KeyboardManagerPage"
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
|
2021-07-05 22:25:23 +08:00
|
|
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
2020-10-23 00:45:48 +08:00
|
|
|
xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Library"
|
2020-07-18 02:01:46 +08:00
|
|
|
mc:Ignorable="d"
|
2020-10-29 02:10:08 +08:00
|
|
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
|
|
|
AutomationProperties.LandmarkType="Main">
|
2020-07-18 02:01:46 +08:00
|
|
|
|
|
|
|
<Page.Resources>
|
|
|
|
<local:VisibleIfNotEmpty x:Key="visibleIfNotEmptyConverter" />
|
2020-09-05 03:42:41 +08:00
|
|
|
<Style TargetType="ListViewItem" x:Name="KeysListViewContainerStyle">
|
|
|
|
<Setter Property="IsTabStop" Value="False"/>
|
|
|
|
</Style>
|
2020-07-18 02:01:46 +08:00
|
|
|
<DataTemplate x:Name="KeysListViewTemplate" x:DataType="Lib:KeysDataModel">
|
2020-09-09 01:25:53 +08:00
|
|
|
<StackPanel
|
|
|
|
Name="KeyboardManager_RemappedKeysListItem"
|
|
|
|
x:Uid="KeyboardManager_RemappedKeysListItem"
|
2020-07-18 02:01:46 +08:00
|
|
|
Orientation="Horizontal"
|
|
|
|
Height="56">
|
|
|
|
<ItemsControl
|
2020-10-10 08:58:52 +08:00
|
|
|
ItemsSource="{x:Bind GetMappedOriginalKeys()}"
|
2020-09-05 03:42:41 +08:00
|
|
|
IsTabStop="False">
|
2020-07-18 02:01:46 +08:00
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Horizontal"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<Border
|
|
|
|
Background="{ThemeResource SystemBaseLowColor}"
|
|
|
|
CornerRadius="4"
|
|
|
|
Padding="14,0,14,0"
|
|
|
|
Margin="5,0,5,0"
|
|
|
|
Height="36"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
HorizontalAlignment="Left">
|
|
|
|
<TextBlock
|
|
|
|
FontWeight="SemiBold"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
TextAlignment="Center"
|
|
|
|
FontSize="12"
|
|
|
|
Text="{Binding}" />
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
<FontIcon Glyph=""
|
|
|
|
Grid.Column="1"
|
|
|
|
FontSize="14"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Margin="5,0,5,0"/>
|
|
|
|
<ItemsControl
|
2020-09-09 01:25:53 +08:00
|
|
|
Name="KeyboardManager_RemappedTo"
|
|
|
|
x:Uid="KeyboardManager_RemappedTo"
|
2020-10-10 08:58:52 +08:00
|
|
|
ItemsSource="{x:Bind GetMappedNewRemapKeys()}"
|
2020-09-05 03:42:41 +08:00
|
|
|
Grid.Column="2"
|
|
|
|
IsTabStop="False">
|
2020-07-18 02:01:46 +08:00
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Horizontal"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<Border
|
|
|
|
Background="{ThemeResource SystemAccentColor}"
|
|
|
|
CornerRadius="4"
|
|
|
|
Padding="14,0,14,0"
|
|
|
|
Margin="5,0,5,0"
|
|
|
|
Height="36"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
HorizontalAlignment="Left">
|
|
|
|
<TextBlock
|
|
|
|
FontWeight="SemiBold"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
TextAlignment="Center"
|
|
|
|
Foreground="White"
|
|
|
|
FontSize="12"
|
|
|
|
Text="{Binding}" />
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
<DataTemplate x:Name="ShortcutKeysListViewTemplate" x:DataType="Lib:AppSpecificKeysDataModel">
|
2020-09-09 01:25:53 +08:00
|
|
|
<StackPanel
|
|
|
|
Name="KeyboardManager_RemappedShortcutsListItem"
|
|
|
|
x:Uid="KeyboardManager_RemappedShortcutsListItem"
|
2020-07-18 02:01:46 +08:00
|
|
|
Orientation="Horizontal"
|
|
|
|
Height="56">
|
|
|
|
<ItemsControl
|
2020-10-10 08:58:52 +08:00
|
|
|
ItemsSource="{x:Bind GetMappedOriginalKeys()}"
|
2020-09-05 03:42:41 +08:00
|
|
|
IsTabStop="False">
|
2020-07-18 02:01:46 +08:00
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Horizontal"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<Border
|
|
|
|
Background="{ThemeResource SystemBaseLowColor}"
|
|
|
|
CornerRadius="4"
|
|
|
|
Padding="14,0,14,0"
|
|
|
|
Margin="5,0,5,0"
|
|
|
|
Height="36"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
HorizontalAlignment="Left">
|
|
|
|
<TextBlock
|
|
|
|
FontWeight="SemiBold"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
TextAlignment="Center"
|
|
|
|
FontSize="12"
|
|
|
|
Text="{Binding}" />
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
<FontIcon Glyph=""
|
|
|
|
Grid.Column="1"
|
|
|
|
FontSize="14"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Margin="5,0,5,0"/>
|
2020-09-09 01:25:53 +08:00
|
|
|
<ItemsControl Name="KeyboardManager_ShortcutRemappedTo"
|
|
|
|
x:Uid="KeyboardManager_ShortcutRemappedTo"
|
2020-10-10 08:58:52 +08:00
|
|
|
ItemsSource="{x:Bind GetMappedNewRemapKeys()}"
|
2020-09-05 03:42:41 +08:00
|
|
|
Grid.Column="2"
|
|
|
|
IsTabStop="False">
|
2020-07-18 02:01:46 +08:00
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Horizontal"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<Border
|
|
|
|
Background="{ThemeResource SystemAccentColor}"
|
|
|
|
CornerRadius="4"
|
|
|
|
Padding="14,0,14,0"
|
|
|
|
Margin="5,0,5,0"
|
|
|
|
Height="36"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
HorizontalAlignment="Left">
|
|
|
|
<TextBlock
|
|
|
|
FontWeight="SemiBold"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
TextAlignment="Center"
|
|
|
|
Foreground="White"
|
|
|
|
FontSize="12"
|
|
|
|
Text="{Binding}" />
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
<FontIcon Glyph=""
|
|
|
|
Grid.Column="3"
|
|
|
|
FontSize="14"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Margin="5,0,5,0"/>
|
|
|
|
<Border
|
2020-09-09 01:25:53 +08:00
|
|
|
Name="KeyboardManager_TargetApp"
|
|
|
|
x:Uid="KeyboardManager_TargetApp"
|
2020-07-18 02:01:46 +08:00
|
|
|
Background="{ThemeResource SystemAccentColor}"
|
|
|
|
Grid.Column="4"
|
|
|
|
CornerRadius="4"
|
|
|
|
Padding="14,0,14,0"
|
|
|
|
Margin="5,0,5,0"
|
|
|
|
Height="36"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
HorizontalAlignment="Left">
|
|
|
|
<TextBlock
|
|
|
|
FontWeight="SemiBold"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
TextAlignment="Center"
|
|
|
|
Foreground="White"
|
|
|
|
FontSize="12"
|
|
|
|
Text="{x:Bind TargetApp}" />
|
|
|
|
</Border>
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
</Page.Resources>
|
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<controls:SettingsPageControl x:Uid="About_KeyboardManager"
|
|
|
|
ModuleImageSource="ms-appx:///Assets/Modules/KBM.png"
|
|
|
|
ModuleImageLink="https://aka.ms/PowerToysOverview_KeyboardManage">
|
|
|
|
<controls:SettingsPageControl.ModuleContent>
|
|
|
|
<StackPanel Orientation="Vertical">
|
|
|
|
<ToggleSwitch x:Uid="KeyboardManager_EnableToggle"
|
2020-07-25 03:02:56 +08:00
|
|
|
IsOn="{x:Bind Path=ViewModel.Enabled, Mode=TwoWay}"/>
|
2020-07-18 02:01:46 +08:00
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<HyperlinkButton NavigateUri="https://aka.ms/powerToysCannotRemapKeys" Margin="{StaticResource XSmallTopMargin}">
|
|
|
|
<TextBlock x:Uid="KBM_KeysCannotBeRemapped" />
|
|
|
|
</HyperlinkButton>
|
|
|
|
|
|
|
|
<!--<TextBlock x:Uid="KeyboardManager_ConfigHeader"
|
2020-07-18 02:01:46 +08:00
|
|
|
Style="{StaticResource SettingsGroupTitleStyle}"/>
|
|
|
|
|
|
|
|
<TextBlock x:Uid="KeyboardManager_ProfileDescription"
|
|
|
|
Margin="{StaticResource SmallTopMargin}"/>
|
|
|
|
|
|
|
|
<ComboBox SelectedIndex="1" MinWidth="160"
|
|
|
|
Margin="{StaticResource SmallTopMargin}">
|
|
|
|
<ComboBoxItem Content="Config-1"/>
|
|
|
|
<ComboBoxItem Content="Config-2"/>
|
|
|
|
<ComboBoxItem Content="Config-3"/>
|
|
|
|
</ComboBox>-->
|
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<TextBlock x:Uid="KeyboardManager_RemapKeyboardHeader"
|
2020-07-25 03:02:56 +08:00
|
|
|
Style="{StaticResource SettingsGroupTitleStyle}"
|
2021-07-02 18:24:49 +08:00
|
|
|
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.Enabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/>
|
2020-07-18 02:01:46 +08:00
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<TextBlock x:Uid="KeyboardManager_RemapKeyboardSubtitle"
|
2020-07-25 03:02:56 +08:00
|
|
|
Margin="{StaticResource SmallTopMargin}"
|
2021-07-02 18:24:49 +08:00
|
|
|
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.Enabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/>
|
2020-07-18 02:01:46 +08:00
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<Button x:Uid="KeyboardManager_RemapKeyboardButton"
|
2020-07-18 02:01:46 +08:00
|
|
|
Margin="{StaticResource SmallTopMargin}"
|
|
|
|
Command="{Binding Path=RemapKeyboardCommand}"
|
2021-07-05 22:25:23 +08:00
|
|
|
Style="{StaticResource AccentButtonStyle}"
|
2020-07-18 02:01:46 +08:00
|
|
|
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/>
|
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<ListView x:Name="RemapKeysList"
|
2020-09-09 01:25:53 +08:00
|
|
|
x:Uid="RemapKeysList"
|
2020-07-18 02:01:46 +08:00
|
|
|
extensions:ListViewExtensions.AlternateColor="{ThemeResource SystemControlBackgroundListLowBrush}"
|
|
|
|
ItemsSource="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay}"
|
|
|
|
ItemTemplate="{StaticResource KeysListViewTemplate}"
|
|
|
|
BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}"
|
|
|
|
BorderThickness="1"
|
|
|
|
CornerRadius="4"
|
|
|
|
MinWidth="350"
|
|
|
|
MaxHeight="200"
|
|
|
|
Margin="{StaticResource SmallTopBottomMargin}"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
SelectionMode="None"
|
|
|
|
IsSwipeEnabled="False"
|
|
|
|
Visibility="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}"
|
|
|
|
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
|
2020-09-05 03:42:41 +08:00
|
|
|
ItemContainerStyle="{StaticResource KeysListViewContainerStyle}"
|
2020-07-18 02:01:46 +08:00
|
|
|
/>
|
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<!--<AppBarButton x:Uid="KeyboardManager_RemapKeyboardButton"
|
2020-07-18 02:01:46 +08:00
|
|
|
Icon="Add"
|
|
|
|
Width="370"
|
|
|
|
Style="{StaticResource AddItemAppBarButtonStyle}"
|
|
|
|
Command="{Binding Path=RemapKeyboardCommand}"
|
|
|
|
Margin="{StaticResource AddItemButtonMargin}"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/>-->
|
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<TextBlock x:Uid="KeyboardManager_RemapShortcutsHeader"
|
2020-07-25 03:02:56 +08:00
|
|
|
Style="{StaticResource SettingsGroupTitleStyle}"
|
2021-07-02 18:24:49 +08:00
|
|
|
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.Enabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/>
|
2020-07-18 02:01:46 +08:00
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<TextBlock x:Uid="KeyboardManager_RemapShortcutsSubtitle"
|
2020-07-25 03:02:56 +08:00
|
|
|
Margin="{StaticResource SmallTopMargin}"
|
2020-08-08 03:00:48 +08:00
|
|
|
TextWrapping="WrapWholeWords"
|
2021-07-02 18:24:49 +08:00
|
|
|
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.Enabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/>
|
2020-07-18 02:01:46 +08:00
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<Button x:Uid="KeyboardManager_RemapShortcutsButton"
|
2020-07-18 02:01:46 +08:00
|
|
|
Margin="{StaticResource SmallTopMargin}"
|
|
|
|
Style="{StaticResource AccentButtonStyle}"
|
|
|
|
Command="{Binding Path=EditShortcutCommand}"
|
|
|
|
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
|
|
|
|
/>
|
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<ListView x:Name="RemapShortcutsList"
|
2020-09-09 01:25:53 +08:00
|
|
|
x:Uid="RemapShortcutsList"
|
2020-07-18 02:01:46 +08:00
|
|
|
extensions:ListViewExtensions.AlternateColor="{ThemeResource SystemControlBackgroundListLowBrush}"
|
|
|
|
ItemsSource="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay}"
|
|
|
|
ItemTemplate="{StaticResource ShortcutKeysListViewTemplate}"
|
|
|
|
BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}"
|
|
|
|
BorderThickness="1"
|
|
|
|
CornerRadius="4"
|
|
|
|
MinWidth="350"
|
|
|
|
MaxHeight="200"
|
|
|
|
Margin="{StaticResource SmallTopBottomMargin}"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
SelectionMode="None"
|
|
|
|
IsSwipeEnabled="False"
|
|
|
|
Visibility="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}"
|
|
|
|
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
|
|
|
|
ScrollViewer.HorizontalScrollMode="Enabled"
|
|
|
|
ScrollViewer.HorizontalScrollBarVisibility="Visible"
|
|
|
|
ScrollViewer.IsHorizontalRailEnabled="True"
|
2020-09-05 03:42:41 +08:00
|
|
|
ItemContainerStyle="{StaticResource KeysListViewContainerStyle}"
|
2020-07-18 02:01:46 +08:00
|
|
|
/>
|
|
|
|
|
2021-07-05 22:25:23 +08:00
|
|
|
<!--<AppBarButton x:Uid="KeyboardManager_RemapShortcutsButton"
|
2020-07-18 02:01:46 +08:00
|
|
|
Icon="Add"
|
|
|
|
Width="370"
|
|
|
|
Style="{StaticResource AddItemAppBarButtonStyle}"
|
|
|
|
Command="{Binding Path=EditShortcutCommand}"
|
|
|
|
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
|
|
|
|
Margin="{StaticResource AddItemButtonMargin}"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
/>-->
|
2020-07-25 03:02:56 +08:00
|
|
|
</StackPanel>
|
2021-07-05 22:25:23 +08:00
|
|
|
</controls:SettingsPageControl.ModuleContent>
|
|
|
|
<controls:SettingsPageControl.ModuleLinks>
|
|
|
|
<controls:SidePanelLink x:Uid="Learn_More" Link="https://aka.ms/PowerToysOverview_KeyboardManager"/>
|
|
|
|
<controls:SidePanelLink x:Uid="Give_Feedback" Link="https://aka.ms/powerToysGiveFeedback"/>
|
|
|
|
</controls:SettingsPageControl.ModuleLinks>
|
|
|
|
</controls:SettingsPageControl>
|
2020-07-25 03:02:56 +08:00
|
|
|
</Page>
|