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"
|
2023-09-14 18:41:31 +02:00
|
|
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
|
|
|
|
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
|
|
|
|
|
xmlns:custom="using:Microsoft.PowerToys.Settings.UI.Controls"
|
2020-07-17 11:01:46 -07:00
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
2023-09-14 18:41:31 +02:00
|
|
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
2022-11-23 19:57:09 +01:00
|
|
|
AutomationProperties.LandmarkType="Main"
|
|
|
|
|
mc:Ignorable="d">
|
2020-07-17 11:01:46 -07:00
|
|
|
|
|
|
|
|
<Page.Resources>
|
2023-09-14 18:41:31 +02:00
|
|
|
<converters:CollectionVisibilityConverter x:Key="CollectionVisibilityConverter" />
|
|
|
|
|
<Style x:Name="KeysListViewContainerStyle" TargetType="ListViewItem">
|
2022-11-23 19:57:09 +01:00
|
|
|
<Setter Property="IsTabStop" Value="False" />
|
2020-09-04 12:42:41 -07:00
|
|
|
</Style>
|
2021-08-23 19:48:52 +02:00
|
|
|
|
2023-09-14 18:41:31 +02:00
|
|
|
<DataTemplate x:Key="OriginalKeyTemplate" x:DataType="x:String">
|
|
|
|
|
<custom:KeyVisual Content="{Binding}" VisualType="SmallOutline" />
|
2021-08-23 19:48:52 +02:00
|
|
|
</DataTemplate>
|
|
|
|
|
|
2023-09-14 18:41:31 +02:00
|
|
|
<DataTemplate x:Key="RemappedKeyTemplate" x:DataType="x:String">
|
|
|
|
|
<custom: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>
|
|
|
|
|
|
2023-09-14 18:41:31 +02:00
|
|
|
<custom:SettingsPageControl x:Uid="KeyboardManager" ModuleImageSource="ms-appx:///Assets/Settings/Modules/KBM.png">
|
|
|
|
|
<custom:SettingsPageControl.ModuleContent>
|
|
|
|
|
<StackPanel ChildrenTransitions="{StaticResource SettingsCardsAnimations}" Orientation="Vertical">
|
|
|
|
|
<controls:SettingsCard
|
2022-11-23 19:57:09 +01:00
|
|
|
x:Uid="KeyboardManager_EnableToggle"
|
2023-07-20 00:12:46 +01:00
|
|
|
HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/FluentIcons/FluentIconsKeyboardManager.png}"
|
2022-11-23 19:57:09 +01:00
|
|
|
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured, Converter={StaticResource BoolNegationConverter}}">
|
2023-09-14 18:41:31 +02:00
|
|
|
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.Enabled, Mode=TwoWay}" />
|
|
|
|
|
<controls:SettingsCard.Description>
|
2021-08-23 19:48:52 +02:00
|
|
|
<HyperlinkButton NavigateUri="https://aka.ms/powerToysCannotRemapKeys">
|
2023-09-14 18:41:31 +02:00
|
|
|
<TextBlock x:Uid="KBM_KeysCannotBeRemapped" FontWeight="SemiBold" />
|
2021-08-23 19:48:52 +02:00
|
|
|
</HyperlinkButton>
|
2023-09-14 18:41:31 +02:00
|
|
|
</controls:SettingsCard.Description>
|
|
|
|
|
</controls:SettingsCard>
|
2022-11-23 19:57:09 +01:00
|
|
|
<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" />
|
|
|
|
|
|
2023-09-14 18:41:31 +02:00
|
|
|
<custom:SettingsGroup x:Uid="KeyboardManager_Keys" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.Enabled}">
|
|
|
|
|
<controls:SettingsCard
|
2022-11-23 19:57:09 +01:00
|
|
|
x:Uid="KeyboardManager_RemapKeyboardButton"
|
2024-01-02 15:09:35 +01:00
|
|
|
ActionIcon="{ui:FontIcon Glyph=}"
|
2022-11-23 19:57:09 +01:00
|
|
|
Command="{Binding Path=RemapKeyboardCommand}"
|
2023-09-14 18:41:31 +02:00
|
|
|
HeaderIcon="{ui:FontIcon Glyph=}"
|
2022-11-23 19:57:09 +01:00
|
|
|
IsClickEnabled="True" />
|
|
|
|
|
|
|
|
|
|
<ListView
|
|
|
|
|
x:Name="RemapKeysList"
|
|
|
|
|
x:Uid="RemapKeysList"
|
|
|
|
|
IsSwipeEnabled="False"
|
|
|
|
|
ItemsSource="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay}"
|
|
|
|
|
SelectionMode="None"
|
2023-09-14 18:41:31 +02:00
|
|
|
Visibility="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay, Converter={StaticResource CollectionVisibilityConverter}}">
|
2021-08-23 19:48:52 +02:00
|
|
|
<ListView.ItemTemplate>
|
|
|
|
|
<DataTemplate x:DataType="Lib:KeysDataModel">
|
2023-09-14 18:41:31 +02:00
|
|
|
<controls:SettingsCard ContentAlignment="Left">
|
2022-11-23 19:57:09 +01:00
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<ItemsControl
|
|
|
|
|
IsTabStop="False"
|
|
|
|
|
ItemTemplate="{StaticResource OriginalKeyTemplate}"
|
|
|
|
|
ItemsSource="{x:Bind GetMappedOriginalKeys()}">
|
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
|
<ItemsPanelTemplate>
|
2023-09-14 18:41:31 +02:00
|
|
|
<StackPanel Orientation="Horizontal" Spacing="4" />
|
2022-11-23 19:57:09 +01:00
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
</ItemsControl>
|
2023-09-14 18:41:31 +02:00
|
|
|
<custom:IsEnabledTextBlock
|
2022-11-23 19:57:09 +01:00
|
|
|
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>
|
2023-09-14 18:41:31 +02:00
|
|
|
<StackPanel Orientation="Horizontal" Spacing="4" />
|
2022-11-23 19:57:09 +01:00
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
</ItemsControl>
|
|
|
|
|
</StackPanel>
|
2023-09-14 18:41:31 +02:00
|
|
|
</controls:SettingsCard>
|
2021-08-23 19:48:52 +02:00
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
</ListView>
|
2023-09-14 18:41:31 +02:00
|
|
|
</custom:SettingsGroup>
|
2021-08-23 19:48:52 +02:00
|
|
|
|
2023-09-14 18:41:31 +02:00
|
|
|
<custom:SettingsGroup x:Uid="KeyboardManager_Shortcuts" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.Enabled}">
|
|
|
|
|
<controls:SettingsCard
|
2022-11-23 19:57:09 +01:00
|
|
|
x:Uid="KeyboardManager_RemapShortcutsButton"
|
2024-01-02 15:09:35 +01:00
|
|
|
ActionIcon="{ui:FontIcon Glyph=}"
|
2022-11-23 19:57:09 +01:00
|
|
|
Command="{Binding Path=EditShortcutCommand}"
|
2023-09-14 18:41:31 +02:00
|
|
|
HeaderIcon="{ui:FontIcon Glyph=}"
|
2022-11-23 19:57:09 +01:00
|
|
|
IsClickEnabled="True" />
|
|
|
|
|
|
|
|
|
|
<ListView
|
|
|
|
|
x:Name="RemapShortcutsList"
|
|
|
|
|
x:Uid="RemapShortcutsList"
|
|
|
|
|
IsSwipeEnabled="False"
|
|
|
|
|
ItemsSource="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay}"
|
|
|
|
|
SelectionMode="None"
|
2023-09-14 18:41:31 +02:00
|
|
|
Visibility="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay, Converter={StaticResource CollectionVisibilityConverter}}">
|
2021-08-23 19:48:52 +02:00
|
|
|
<ListView.ItemTemplate>
|
|
|
|
|
<DataTemplate x:DataType="Lib:AppSpecificKeysDataModel">
|
2023-09-14 18:41:31 +02:00
|
|
|
<controls: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>
|
2023-09-14 18:41:31 +02:00
|
|
|
<StackPanel Orientation="Horizontal" Spacing="4" />
|
2022-11-23 19:57:09 +01:00
|
|
|
</ItemsPanelTemplate>
|
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
</ItemsControl>
|
2023-09-14 18:41:31 +02:00
|
|
|
<custom:IsEnabledTextBlock
|
2022-11-23 19:57:09 +01:00
|
|
|
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>
|
2023-09-14 18:41:31 +02:00
|
|
|
<StackPanel Orientation="Horizontal" Spacing="4" />
|
2022-11-23 19:57:09 +01:00
|
|
|
</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>
|
2023-09-14 18:41:31 +02: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>
|
2023-09-14 18:41:31 +02:00
|
|
|
</controls:SettingsCard>
|
2021-08-23 19:48:52 +02:00
|
|
|
</DataTemplate>
|
|
|
|
|
</ListView.ItemTemplate>
|
|
|
|
|
</ListView>
|
2023-09-14 18:41:31 +02:00
|
|
|
</custom:SettingsGroup>
|
2020-07-24 21:02:56 +02:00
|
|
|
</StackPanel>
|
2023-09-14 18:41:31 +02:00
|
|
|
</custom:SettingsPageControl.ModuleContent>
|
|
|
|
|
<custom:SettingsPageControl.PrimaryLinks>
|
|
|
|
|
<custom:PageLink x:Uid="LearnMore_KBM" Link="https://aka.ms/PowerToysOverview_KeyboardManager" />
|
|
|
|
|
</custom:SettingsPageControl.PrimaryLinks>
|
|
|
|
|
</custom:SettingsPageControl>
|
2021-08-24 19:21:48 +02:00
|
|
|
</Page>
|