Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,22 @@ public List<object> GetKeysList(ShortcutDescription description)

foreach (var key in description.Keys)
{
// Try to parse a string key number to a VirtualKey
// Try to parse a string key number to a key code
if (int.TryParse(key, out int keyCode))
{
shortcutList.Add(keyCode);
switch (keyCode)
{
// https://learn.microsoft.com/uwp/api/windows.system.virtualkey?view=winrt-20348
case 38: // The Up Arrow key or button.
case 40: // The Down Arrow key or button.
case 37: // The Left Arrow key or button.
case 39: // The Right Arrow key or button.
shortcutList.Add(keyCode);
break;
default:
shortcutList.Add(Microsoft.PowerToys.Settings.UI.Library.Utilities.Helper.GetKeyName((uint)keyCode));
break;
}
}
else
{
Expand Down
Loading