Skip to content

Commit 6bf6d25

Browse files
committed
fix: failing test
1 parent cffa0d7 commit 6bf6d25

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/Helpers/VirtualKeyHelper.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,27 @@ public static string GetCombinationDisplayName(List<int> virtualKeys)
144144
var names = virtualKeys
145145
.Select(GetFriendlyName)
146146
.Distinct()
147-
.OrderBy(name => IsModifierName(name) ? 0 : 1) // Modifiers first
147+
.OrderBy(name => GetModifierOrder(name)) // Modifiers in standard order
148148
.ThenBy(name => name);
149149

150150
return string.Join(" + ", names);
151151
}
152152

153+
/// <summary>
154+
/// Gets the sort order for a key name (modifiers first in standard order, then others)
155+
/// </summary>
156+
private static int GetModifierOrder(string name)
157+
{
158+
return name switch
159+
{
160+
"Ctrl" => 0,
161+
"Alt" => 1,
162+
"Shift" => 2,
163+
"Win" => 3,
164+
_ => 100 // Non-modifiers last
165+
};
166+
}
167+
153168
/// <summary>
154169
/// Check if a VK code is a modifier key
155170
/// </summary>

0 commit comments

Comments
 (0)