File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff 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>
You can’t perform that action at this time.
0 commit comments