[Keyboard Manager] Adding KBM to shortcut list on Dashboard page (#45938)

Found during manual testing
Open (new) Keyboard Manager shortcut is now shown in the "Shortcuts"
menu when the module is enabled and the new editor is being used.
<img width="1453" height="1367" alt="image"
src="https://github.com/user-attachments/assets/05de4337-9420-460c-b579-8f471a49d4f6"
/>
This commit is contained in:
Jaylyn Barbee
2026-03-09 14:06:56 -04:00
committed by GitHub
parent 9859fb6196
commit d1605640ca
3 changed files with 21 additions and 1 deletions

View File

@@ -12,6 +12,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<WindowsPackageType>None</WindowsPackageType> <WindowsPackageType>None</WindowsPackageType>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<ApplicationIcon>Assets\KeyboardManagerEditor\Keyboard.ico</ApplicationIcon>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath> <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<AssemblyName>PowerToys.KeyboardManagerEditorUI</AssemblyName> <AssemblyName>PowerToys.KeyboardManagerEditorUI</AssemblyName>
@@ -68,7 +69,7 @@
<ProjectReference Include="..\KeyboardManagerEditorLibraryWrapper\KeyboardManagerEditorLibraryWrapper.vcxproj" /> <ProjectReference Include="..\KeyboardManagerEditorLibraryWrapper\KeyboardManagerEditorLibraryWrapper.vcxproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Update="Assets\KeyboardManagerEditor\Keyboard.ico"> <Content Include="Assets\KeyboardManagerEditor\Keyboard.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Update="Assets\KeyboardManagerEditor\Square150x150Logo.png"> <Content Update="Assets\KeyboardManagerEditor\Square150x150Logo.png">

View File

@@ -594,6 +594,10 @@ opera.exe</value>
<value>Set and manage your remappings</value> <value>Set and manage your remappings</value>
<comment>Description for the new editor button</comment> <comment>Description for the new editor button</comment>
</data> </data>
<data name="Dashboard_KeyboardManager_OpenEditor" xml:space="preserve">
<value>Open Keyboard Manager</value>
<comment>Label for the Keyboard Manager editor shortcut on the dashboard page</comment>
</data>
<data name="KeyboardManager_GoBackClassic.Content" xml:space="preserve"> <data name="KeyboardManager_GoBackClassic.Content" xml:space="preserve">
<value>Switch back to the classic editor</value> <value>Switch back to the classic editor</value>
<comment>Keyboard Manager link to switch back to the classic editor UI</comment> <comment>Keyboard Manager link to switch back to the classic editor UI</comment>

View File

@@ -498,6 +498,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
ModuleType.FancyZones => GetModuleItemsFancyZones(), ModuleType.FancyZones => GetModuleItemsFancyZones(),
ModuleType.FindMyMouse => GetModuleItemsFindMyMouse(), ModuleType.FindMyMouse => GetModuleItemsFindMyMouse(),
ModuleType.Hosts => GetModuleItemsHosts(), ModuleType.Hosts => GetModuleItemsHosts(),
ModuleType.KeyboardManager => GetModuleItemsKeyboardManager(),
ModuleType.LightSwitch => GetModuleItemsLightSwitch(), ModuleType.LightSwitch => GetModuleItemsLightSwitch(),
ModuleType.MouseHighlighter => GetModuleItemsMouseHighlighter(), ModuleType.MouseHighlighter => GetModuleItemsMouseHighlighter(),
ModuleType.MouseJump => GetModuleItemsMouseJump(), ModuleType.MouseJump => GetModuleItemsMouseJump(),
@@ -634,6 +635,20 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
return new ObservableCollection<DashboardModuleItem>(list); return new ObservableCollection<DashboardModuleItem>(list);
} }
private ObservableCollection<DashboardModuleItem> GetModuleItemsKeyboardManager()
{
ISettingsRepository<KeyboardManagerSettings> moduleSettingsRepository = SettingsRepository<KeyboardManagerSettings>.GetInstance(SettingsUtils.Default);
var settings = moduleSettingsRepository.SettingsConfig;
var list = new List<DashboardModuleItem>();
if (settings.Properties.UseNewEditor)
{
list.Add(new DashboardModuleShortcutItem() { Label = resourceLoader.GetString("Dashboard_KeyboardManager_OpenEditor"), Shortcut = settings.Properties.EditorShortcut.GetKeysList() });
}
return new ObservableCollection<DashboardModuleItem>(list);
}
private ObservableCollection<DashboardModuleItem> GetModuleItemsMouseHighlighter() private ObservableCollection<DashboardModuleItem> GetModuleItemsMouseHighlighter()
{ {
ISettingsRepository<MouseHighlighterSettings> moduleSettingsRepository = SettingsRepository<MouseHighlighterSettings>.GetInstance(SettingsUtils.Default); ISettingsRepository<MouseHighlighterSettings> moduleSettingsRepository = SettingsRepository<MouseHighlighterSettings>.GetInstance(SettingsUtils.Default);