[KBM]Allow remapping keys and shortcuts to arbitrary unicode sequences (#29399)

* [KBM] Allow remapping keys and shortcuts to arbitrary unicode sequences

* f: spelling

* f: tests

* f: split shortcut configuration

* f: address ui layout comments

* [BugReport]Don't report personal info

* f: fix crash in KBME

* f: add missed type button

* f: fix shortcut line UI elements alignment

* f: align elements size

* f: add warning about non-mapped keys
This commit is contained in:
Andrey Nekrasov
2023-11-23 11:46:07 +01:00
committed by GitHub
parent 2543dee1f1
commit f742d3c1c3
32 changed files with 698 additions and 173 deletions

View File

@@ -158,7 +158,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
if (_profile != null)
{
return _profile.RemapKeys.InProcessRemapKeys;
return _profile.RemapKeys.InProcessRemapKeys.Concat(_profile.RemapKeysToText.InProcessRemapKeys).ToList();
}
else
{
@@ -190,11 +190,11 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
else if (appSpecificShortcutList == null)
{
return globalShortcutList.ConvertAll(x => new AppSpecificKeysDataModel { OriginalKeys = x.OriginalKeys, NewRemapKeys = x.NewRemapKeys, TargetApp = allAppsDescription }).ToList();
return globalShortcutList.ConvertAll(x => new AppSpecificKeysDataModel { OriginalKeys = x.OriginalKeys, NewRemapKeys = x.NewRemapKeys, NewRemapString = x.NewRemapString, TargetApp = allAppsDescription }).ToList();
}
else
{
return globalShortcutList.ConvertAll(x => new AppSpecificKeysDataModel { OriginalKeys = x.OriginalKeys, NewRemapKeys = x.NewRemapKeys, TargetApp = allAppsDescription }).Concat(appSpecificShortcutList).ToList();
return globalShortcutList.ConvertAll(x => new AppSpecificKeysDataModel { OriginalKeys = x.OriginalKeys, NewRemapKeys = x.NewRemapKeys, NewRemapString = x.NewRemapString, TargetApp = allAppsDescription }).Concat(appSpecificShortcutList).ToList();
}
}
@@ -204,7 +204,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
if (_profile != null)
{
return CombineShortcutLists(_profile.RemapShortcuts.GlobalRemapShortcuts, _profile.RemapShortcuts.AppSpecificRemapShortcuts);
return CombineShortcutLists(_profile.RemapShortcuts.GlobalRemapShortcuts, _profile.RemapShortcuts.AppSpecificRemapShortcuts).Concat(CombineShortcutLists(_profile.RemapShortcutsToText.GlobalRemapShortcuts, _profile.RemapShortcutsToText.AppSpecificRemapShortcuts)).ToList();
}
else
{
@@ -333,6 +333,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
if (readSuccessfully)
{
FilterRemapKeysList(_profile?.RemapKeys?.InProcessRemapKeys);
FilterRemapKeysList(_profile?.RemapKeysToText?.InProcessRemapKeys);
}
else
{