2020-07-17 11:01:46 -07: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"
|
2022-11-23 19:57:09 +01:00
|
|
|
xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Library"
|
|
|
|
|
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
|
|
|
|
|
xmlns:converters="using:Microsoft.PowerToys.Settings.UI.Converters"
|
2020-07-17 11:01:46 -07:00
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
2022-11-23 19:57:09 +01:00
|
|
|
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
|
2020-07-17 11:01:46 -07:00
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
2022-11-23 19:57:09 +01:00
|
|
|
xmlns:ui="using:CommunityToolkit.WinUI.UI"
|
|
|
|
|
AutomationProperties.LandmarkType="Main"
|
|
|
|
|
mc:Ignorable="d">
|
2020-07-17 11:01:46 -07:00
|
|
|
|
|
|
|
|
<Page.Resources>
|
2022-11-23 19:57:09 +01:00
|
|
|
<converters:VisibleIfNotEmptyConverter x:Key="visibleIfNotEmptyConverter" />
|
2022-10-26 14:02:31 +01:00
|
|
|
|
2022-11-23 19:57:09 +01:00
|
|
|
<Style
|
|
|
|
|
x:Name="KeysListViewContainerStyle"
|
|
|
|
|
TargetType="ListViewItem">
|
|
|
|
|
<Setter Property="IsTabStop" Value="False" />
|
2020-09-04 12:42:41 -07:00
|
|
|
</Style>
|
2021-08-23 19:48:52 +02:00
|
|
|
|
2022-11-23 19:57:09 +01:00
|
|
|
<DataTemplate
|
|
|
|
|
x:Key="OriginalKeyTemplate"
|
|
|
|
|
x:DataType="x:String">
|
|
|
|
|
<controls:KeyVisual
|
|
|
|
|
Content="{Binding}"
|
|
|
|
|
VisualType="SmallOutline" />
|
2021-08-23 19:48:52 +02:00
|
|
|
</DataTemplate>
|
|
|
|
|
|
2022-11-23 19:57:09 +01:00
|
|
|
<DataTemplate
|
|
|
|
|
x:Key="RemappedKeyTemplate"
|
|
|
|
|
x:DataType="x:String">
|
|
|
|
|
<controls:KeyVisual
|
|
|
|
|
Content="{Binding}"
|
|
|
|
|
VisualType="Small" />
|
2021-08-23 19:48:52 +02:00
|
|
|
</DataTemplate>
|
|
|
|
|
|
|
|
|
|
<!--<DataTemplate x:Name="KeysListViewTemplate" x:DataType="Lib:KeysDataModel">
|
2022-11-23 19:57:09 +01:00
|
|
|
<StackPanel
|
|
|
|
|
Name="KeyboardManager_RemappedKeysListItem"
|
2020-09-08 10:25:53 -07:00
|
|
|
x:Uid="KeyboardManager_RemappedKeysListItem"
|
2020-07-17 11:01:46 -07:00
|
|
|
Orientation="Horizontal"
|
|
|
|
|
Height="56">
|
2022-11-23 19:57:09 +01:00
|
|
|
|
2020-07-17 11:01:46 -07:00
|
|
|
</StackPanel>
|
2021-08-23 19:48:52 +02:00
|
|
|
</DataTemplate>-->
|
|
|
|
|
<!--<DataTemplate x:Name="ShortcutKeysListViewTemplate" x:DataType="Lib:AppSpecificKeysDataModel">
|
2022-11-23 19:57:09 +01:00
|
|
|
<StackPanel
|
|
|
|
|
Name="KeyboardManager_RemappedShortcutsListItem"
|
2020-09-08 10:25:53 -07:00
|
|
|
x:Uid="KeyboardManager_RemappedShortcutsListItem"
|
2020-07-17 11:01:46 -07:00
|
|
|
Orientation="Horizontal"
|
|
|
|
|
Height="56">
|
2022-11-23 19:57:09 +01:00
|
|
|
|
2021-08-23 19:48:52 +02:00
|
|
|
</DataTemplate>-->
|
2020-07-17 11:01:46 -07:00
|
|
|
</Page.Resources>
|
|
|
|
|
|
2022-11-23 19:57:09 +01:00
|
|
|
<controls:SettingsPageControl
|
|
|
|
|
x:Uid="KeyboardManager"
|
|
|
|
|
ModuleImageSource="ms-appx:///Assets/Modules/KBM.png">
|
2021-07-05 16:25:23 +02:00
|
|
|
<controls:SettingsPageControl.ModuleContent>
|
|
|
|
|
<StackPanel Orientation="Vertical">
|
2022-11-23 19:57:09 +01:00
|
|
|
<labs:SettingsCard
|
|
|
|
|
x:Uid="KeyboardManager_EnableToggle"
|
|
|
|
|
HeaderIcon="{ui:BitmapIcon Source=/Assets/FluentIcons/FluentIconsKeyboardManager.png}"
|
|
|
|
|
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured, Converter={StaticResource BoolNegationConverter}}">
|
|
|
|
|
<ToggleSwitch
|
|
|
|
|
x:Uid="ToggleSwitch"
|
|
|
|
|
IsOn="{x:Bind ViewModel.Enabled, Mode=TwoWay}" />
|
|
|
|
|
<labs:SettingsCard.Description>
|
2021-08-23 19:48:52 +02:00
|
|
|
<HyperlinkButton NavigateUri="https://aka.ms/powerToysCannotRemapKeys">
|
2022-11-23 19:57:09 +01:00
|
|
|
<TextBlock
|
|
|
|
|
x:Uid="KBM_KeysCannotBeRemapped"
|
|
|
|
|
FontWeight="SemiBold" />
|
2021-08-23 19:48:52 +02:00
|
|
|
</HyperlinkButton>
|
2022-11-23 19:57:09 +01:00
|
|
|
</labs:SettingsCard.Description>
|
|
|
|
|
</labs:SettingsCard>
|
|
|
|
|
<InfoBar
|
|
|
|
|
x:Uid="GPO_IsSettingForced"
|
2022-10-26 14:02:31 +01:00
|
|
|
IsClosable="False"
|
|
|
|
|
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured}"
|
2022-11-23 19:57:09 +01:00
|
|
|
IsTabStop="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured}"
|
|
|
|
|
Severity="Informational" />
|
|
|
|
|
|
|
|
|
|
<controls:SettingsGroup
|
|
|
|
|
x:Uid="KeyboardManager_Keys"
|
|
|
|
|
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.Enabled}">
|
|
|
|
|
<labs:SettingsCard
|
|
|
|
|
x:Uid="KeyboardManager_RemapKeyboardButton"
|
|
|
|
|
ActionIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily},
|
|
|
|
|
FontSize=14,
|
|
|
|
|
Glyph=}"
|
|
|
|
|
Command="{Binding Path=RemapKeyboardCommand}"
|
|
|
|
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily},
|
|
|
|
|
Glyph=}"
|
|
|
|
|
IsClickEnabled="True" />
|
|
|
|
|
|
|
|
|
|
<ListView
|
|
|
|
|
x:Name="RemapKeysList"
|
|
|
|
|
x:Uid="RemapKeysList"
|
|
|
|
|
IsSwipeEnabled="False"
|
|
|
|
|
ItemsSource="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay}"
|
|
|
|
|
SelectionMode="None"
|
|
|
|
|
Visibility="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}">
|
2021-08-23 19:48:52 +02:00
|
|
|
<ListView.ItemTemplate>
|
|
|
|
|
<DataTemplate x:DataType="Lib:KeysDataModel">
|
2022-11-23 19:57:09 +01:00
|
|
|
<labs:SettingsCard ContentAlignment="Left">
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<ItemsControl
|
|
|
|
|
IsTabStop="False"
|
|
|
|
|
ItemTemplate="{StaticResource OriginalKeyTemplate}"
|
|
|
|
|
ItemsSource="{x:Bind GetMappedOriginalKeys()}">
|
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
|
<StackPanel
|
|
|
|
|
Orientation="Horizontal"
|
|
|
|
|
Spacing="4" />
|
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
</ItemsControl>
|
|
|
|
|
<controls:IsEnabledTextBlock
|
|
|
|
|
x:Uid="To"
|
|
|
|
|
Margin="8,0,8,0"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Style="{StaticResource SecondaryIsEnabledTextBlockStyle}" />
|
|
|
|
|
<ItemsControl
|
|
|
|
|
Name="KeyboardManager_RemappedTo"
|
|
|
|
|
x:Uid="KeyboardManager_RemappedTo"
|
|
|
|
|
IsTabStop="False"
|
|
|
|
|
ItemTemplate="{StaticResource RemappedKeyTemplate}"
|
|
|
|
|
ItemsSource="{x:Bind GetMappedNewRemapKeys()}">
|
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
|
<StackPanel
|
|
|
|
|
Orientation="Horizontal"
|
|
|
|
|
Spacing="4" />
|
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
</ItemsControl>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</labs:SettingsCard>
|
2021-08-23 19:48:52 +02:00
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
</ListView>
|
|
|
|
|
</controls:SettingsGroup>
|
|
|
|
|
|
2022-11-23 19:57:09 +01:00
|
|
|
<controls:SettingsGroup
|
|
|
|
|
x:Uid="KeyboardManager_Shortcuts"
|
|
|
|
|
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.Enabled}">
|
|
|
|
|
<labs:SettingsCard
|
|
|
|
|
x:Uid="KeyboardManager_RemapShortcutsButton"
|
|
|
|
|
ActionIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily},
|
|
|
|
|
FontSize=14,
|
|
|
|
|
Glyph=}"
|
|
|
|
|
Command="{Binding Path=EditShortcutCommand}"
|
|
|
|
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily},
|
|
|
|
|
Glyph=}"
|
|
|
|
|
IsClickEnabled="True" />
|
|
|
|
|
|
|
|
|
|
<ListView
|
|
|
|
|
x:Name="RemapShortcutsList"
|
|
|
|
|
x:Uid="RemapShortcutsList"
|
|
|
|
|
IsSwipeEnabled="False"
|
|
|
|
|
ItemsSource="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay}"
|
|
|
|
|
SelectionMode="None"
|
|
|
|
|
Visibility="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}">
|
2021-08-23 19:48:52 +02:00
|
|
|
<ListView.ItemTemplate>
|
|
|
|
|
<DataTemplate x:DataType="Lib:AppSpecificKeysDataModel">
|
2022-11-23 19:57:09 +01:00
|
|
|
<labs:SettingsCard ContentAlignment="Left">
|
2021-08-26 19:53:25 +02:00
|
|
|
<StackPanel Orientation="Horizontal">
|
2022-11-23 19:57:09 +01:00
|
|
|
<ItemsControl
|
|
|
|
|
IsTabStop="False"
|
|
|
|
|
ItemTemplate="{StaticResource OriginalKeyTemplate}"
|
|
|
|
|
ItemsSource="{x:Bind GetMappedOriginalKeys()}">
|
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
|
<StackPanel
|
|
|
|
|
Orientation="Horizontal"
|
|
|
|
|
Spacing="4" />
|
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
</ItemsControl>
|
|
|
|
|
<controls:IsEnabledTextBlock
|
|
|
|
|
x:Uid="To"
|
|
|
|
|
Margin="8,0,8,0"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Style="{StaticResource SecondaryIsEnabledTextBlockStyle}" />
|
|
|
|
|
|
|
|
|
|
<ItemsControl
|
|
|
|
|
Name="KeyboardManager_RemappedTo"
|
|
|
|
|
x:Uid="KeyboardManager_RemappedTo"
|
|
|
|
|
IsTabStop="False"
|
|
|
|
|
ItemTemplate="{StaticResource RemappedKeyTemplate}"
|
|
|
|
|
ItemsSource="{x:Bind GetMappedNewRemapKeys()}">
|
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
|
<StackPanel
|
|
|
|
|
Orientation="Horizontal"
|
|
|
|
|
Spacing="4" />
|
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
</ItemsControl>
|
|
|
|
|
<Border
|
|
|
|
|
Margin="16,0,0,0"
|
|
|
|
|
Padding="12,4,12,6"
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
CornerRadius="12">
|
2021-08-26 19:53:25 +02:00
|
|
|
<Border.Background>
|
2022-11-23 19:57:09 +01:00
|
|
|
<SolidColorBrush
|
|
|
|
|
Opacity="0.3"
|
|
|
|
|
Color="{ThemeResource SystemAccentColor}" />
|
2021-08-26 19:53:25 +02:00
|
|
|
</Border.Background>
|
2022-11-23 19:57:09 +01:00
|
|
|
<TextBlock Text="{x:Bind TargetApp}" />
|
2021-08-26 19:53:25 +02:00
|
|
|
</Border>
|
|
|
|
|
</StackPanel>
|
2022-11-23 19:57:09 +01:00
|
|
|
</labs:SettingsCard>
|
2021-08-23 19:48:52 +02:00
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
</ListView>
|
|
|
|
|
</controls:SettingsGroup>
|
2020-07-24 21:02:56 +02:00
|
|
|
</StackPanel>
|
2021-07-05 16:25:23 +02:00
|
|
|
</controls:SettingsPageControl.ModuleContent>
|
2021-08-23 19:48:52 +02:00
|
|
|
<controls:SettingsPageControl.PrimaryLinks>
|
2022-11-23 19:57:09 +01:00
|
|
|
<controls:PageLink
|
|
|
|
|
x:Uid="LearnMore_KBM"
|
|
|
|
|
Link="https://aka.ms/PowerToysOverview_KeyboardManager" />
|
2021-08-23 19:48:52 +02:00
|
|
|
</controls:SettingsPageControl.PrimaryLinks>
|
2021-07-05 16:25:23 +02:00
|
|
|
</controls:SettingsPageControl>
|
2021-08-24 19:21:48 +02:00
|
|
|
</Page>
|