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"
|
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
|
|
|
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>
|
2021-08-24 01:48:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
<DataTemplate x:Key="OriginalKeyTemplate" x:DataType="x:String">
|
|
|
|
<Border Background="{ThemeResource ButtonBackground}"
|
|
|
|
BorderBrush="{ThemeResource ButtonBorderBrush}"
|
|
|
|
BorderThickness="{ThemeResource ButtonBorderThemeThickness}"
|
|
|
|
CornerRadius="{ThemeResource ControlCornerRadius}"
|
|
|
|
Padding="{ThemeResource ButtonPadding}"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
HorizontalAlignment="Left">
|
|
|
|
<TextBlock FontWeight="SemiBold"
|
|
|
|
Foreground="{ThemeResource ButtonForeground}"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
TextAlignment="Center"
|
|
|
|
FontSize="12"
|
|
|
|
Text="{Binding}" />
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
<DataTemplate x:Key="RemappedKeyTemplate" x:DataType="x:String">
|
|
|
|
<Border Background="{ThemeResource ButtonBackground}"
|
|
|
|
BorderBrush="{ThemeResource AccentButtonBackground}"
|
|
|
|
BorderThickness="{ThemeResource ButtonBorderThemeThickness}"
|
|
|
|
CornerRadius="{ThemeResource ControlCornerRadius}"
|
|
|
|
Padding="{ThemeResource ButtonPadding}"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
HorizontalAlignment="Left">
|
|
|
|
<TextBlock FontWeight="SemiBold"
|
|
|
|
Foreground="{ThemeResource AccentButtonBackground}"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
TextAlignment="Center"
|
|
|
|
FontSize="12"
|
|
|
|
Text="{Binding}" />
|
|
|
|
</Border>
|
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
<!--<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">
|
2021-08-24 01:48:52 +08:00
|
|
|
|
2020-07-18 02:01:46 +08:00
|
|
|
</StackPanel>
|
2021-08-24 01:48:52 +08:00
|
|
|
</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">
|
2021-08-24 01:48:52 +08:00
|
|
|
|
|
|
|
</DataTemplate>-->
|
2020-07-18 02:01:46 +08:00
|
|
|
</Page.Resources>
|
|
|
|
|
2021-08-24 01:48:52 +08:00
|
|
|
<controls:SettingsPageControl x:Uid="KeyboardManager"
|
2021-07-05 22:25:23 +08:00
|
|
|
ModuleImageSource="ms-appx:///Assets/Modules/KBM.png"
|
2021-08-25 01:21:48 +08:00
|
|
|
ModuleImageLink="https://aka.ms/PowerToysOverview_KeyboardManager">
|
2021-07-05 22:25:23 +08:00
|
|
|
<controls:SettingsPageControl.ModuleContent>
|
|
|
|
<StackPanel Orientation="Vertical">
|
2020-07-18 02:01:46 +08:00
|
|
|
|
2021-08-24 01:48:52 +08:00
|
|
|
<controls:Setting x:Uid="KeyboardManager_EnableToggle">
|
|
|
|
<controls:Setting.Icon>
|
|
|
|
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsKeyboardManager.png" ShowAsMonochrome="False" />
|
|
|
|
</controls:Setting.Icon>
|
|
|
|
<controls:Setting.ActionContent>
|
|
|
|
<ToggleSwitch IsOn="{x:Bind Path=ViewModel.Enabled, Mode=TwoWay}" />
|
|
|
|
</controls:Setting.ActionContent>
|
|
|
|
<controls:Setting.Description>
|
|
|
|
<HyperlinkButton NavigateUri="https://aka.ms/powerToysCannotRemapKeys">
|
|
|
|
<TextBlock x:Uid="KBM_KeysCannotBeRemapped" FontWeight="SemiBold" />
|
|
|
|
</HyperlinkButton>
|
|
|
|
</controls:Setting.Description>
|
|
|
|
</controls:Setting>
|
|
|
|
|
|
|
|
|
|
|
|
<controls:SettingsGroup x:Uid="KeyboardManager_Keys" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.Enabled}">
|
|
|
|
|
|
|
|
<Button x:Uid="KeyboardManager_RemapKeyboardButton_Accessible" Style="{StaticResource SettingButtonStyle}" Command="{Binding Path=RemapKeyboardCommand}">
|
|
|
|
<controls:Setting x:Uid="KeyboardManager_RemapKeyboardButton" Style="{StaticResource ExpanderHeaderSettingStyle}" Icon="">
|
|
|
|
<controls:Setting.ActionContent>
|
2021-08-25 01:21:48 +08:00
|
|
|
<FontIcon Glyph="" FontFamily="{ThemeResource SymbolThemeFontFamily}" />
|
2021-08-24 01:48:52 +08:00
|
|
|
</controls:Setting.ActionContent>
|
|
|
|
</controls:Setting>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<ListView x:Name="RemapKeysList"
|
|
|
|
x:Uid="RemapKeysList"
|
|
|
|
ItemsSource="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay}"
|
|
|
|
SelectionMode="None"
|
|
|
|
IsSwipeEnabled="False"
|
|
|
|
Visibility="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}">
|
|
|
|
<ListView.ItemTemplate>
|
|
|
|
<DataTemplate x:DataType="Lib:KeysDataModel">
|
|
|
|
<StackPanel Orientation="Horizontal"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Background="{ThemeResource CardBackgroundBrush}"
|
|
|
|
BorderThickness="{ThemeResource CardBorderThickness}"
|
|
|
|
BorderBrush="{ThemeResource CardBorderBrush}"
|
|
|
|
CornerRadius="{ThemeResource ControlCornerRadius}"
|
|
|
|
MinHeight="68">
|
|
|
|
|
|
|
|
<ItemsControl Margin="52,0,0,0"
|
|
|
|
ItemsSource="{x:Bind GetMappedOriginalKeys()}"
|
|
|
|
ItemTemplate="{StaticResource OriginalKeyTemplate}"
|
|
|
|
IsTabStop="False">
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Horizontal"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
</ItemsControl>
|
|
|
|
<TextBlock Text="to"
|
|
|
|
Style="{StaticResource SecondaryTextStyle}"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Margin="8,0,8,0"/>
|
|
|
|
|
|
|
|
<ItemsControl Name="KeyboardManager_RemappedTo"
|
|
|
|
x:Uid="KeyboardManager_RemappedTo"
|
|
|
|
ItemsSource="{x:Bind GetMappedNewRemapKeys()}"
|
|
|
|
ItemTemplate="{StaticResource RemappedKeyTemplate}"
|
|
|
|
IsTabStop="False">
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Horizontal"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
</ItemsControl>
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
</ListView>
|
|
|
|
</controls:SettingsGroup>
|
|
|
|
|
|
|
|
|
|
|
|
<controls:SettingsGroup x:Uid="KeyboardManager_Shortcuts" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.Enabled}">
|
|
|
|
<Button x:Uid="KeyboardManager_RemapShortcutsButton_Accessible" Style="{StaticResource SettingButtonStyle}" Command="{Binding Path=EditShortcutCommand}">
|
|
|
|
<controls:Setting x:Uid="KeyboardManager_RemapShortcutsButton" Style="{StaticResource ExpanderHeaderSettingStyle}" Icon="">
|
|
|
|
<controls:Setting.ActionContent>
|
2021-08-25 01:21:48 +08:00
|
|
|
<FontIcon Glyph="" FontFamily="{ThemeResource SymbolThemeFontFamily}" />
|
2021-08-24 01:48:52 +08:00
|
|
|
</controls:Setting.ActionContent>
|
|
|
|
</controls:Setting>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<ListView x:Name="RemapShortcutsList"
|
|
|
|
x:Uid="RemapShortcutsList"
|
|
|
|
ItemsSource="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay}"
|
|
|
|
SelectionMode="None"
|
|
|
|
IsSwipeEnabled="False"
|
|
|
|
Visibility="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}">
|
|
|
|
<ListView.ItemTemplate>
|
|
|
|
<DataTemplate x:DataType="Lib:AppSpecificKeysDataModel">
|
|
|
|
<StackPanel Orientation="Horizontal"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
Background="{ThemeResource CardBackgroundBrush}"
|
|
|
|
BorderThickness="{ThemeResource CardBorderThickness}"
|
|
|
|
BorderBrush="{ThemeResource CardBorderBrush}"
|
|
|
|
CornerRadius="{ThemeResource ControlCornerRadius}"
|
|
|
|
MinHeight="68">
|
|
|
|
|
|
|
|
<ItemsControl Margin="52,0,0,0"
|
|
|
|
ItemsSource="{x:Bind GetMappedOriginalKeys()}"
|
|
|
|
ItemTemplate="{StaticResource OriginalKeyTemplate}"
|
|
|
|
IsTabStop="False">
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Horizontal" Spacing="4"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
</ItemsControl>
|
|
|
|
<TextBlock x:Uid="To"
|
|
|
|
Style="{StaticResource SecondaryTextStyle}"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Margin="8,0,8,0"/>
|
|
|
|
|
|
|
|
<ItemsControl Name="KeyboardManager_RemappedTo"
|
|
|
|
x:Uid="KeyboardManager_RemappedTo"
|
|
|
|
ItemsSource="{x:Bind GetMappedNewRemapKeys()}"
|
|
|
|
ItemTemplate="{StaticResource RemappedKeyTemplate}"
|
|
|
|
IsTabStop="False">
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel Orientation="Horizontal" Spacing="4"/>
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
</ItemsControl>
|
|
|
|
|
|
|
|
<TextBlock Margin="8,0,0,0" Style="{StaticResource SecondaryTextStyle}" VerticalAlignment="Center">
|
|
|
|
<Run Text="{x:Bind TargetApp}" FontWeight="SemiBold"/>
|
|
|
|
</TextBlock>
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
</ListView>
|
|
|
|
</controls:SettingsGroup>
|
2020-07-25 03:02:56 +08:00
|
|
|
</StackPanel>
|
2021-07-05 22:25:23 +08:00
|
|
|
</controls:SettingsPageControl.ModuleContent>
|
2021-08-24 01:48:52 +08:00
|
|
|
<controls:SettingsPageControl.PrimaryLinks>
|
|
|
|
<controls:PageLink x:Uid="LearnMore_KBM" Link="https://aka.ms/PowerToysOverview_KeyboardManager"/>
|
|
|
|
</controls:SettingsPageControl.PrimaryLinks>
|
2021-07-05 22:25:23 +08:00
|
|
|
</controls:SettingsPageControl>
|
2021-08-25 01:21:48 +08:00
|
|
|
</Page>
|