They way this works is the enum should contain every possible combination of key "types". All sort does is determine the type and use it's position in the enum to know where to sort it. If two keys are of the same type, they are sorted alphabetically by their id.
Or you can extend from the class and implement a custom sort function.
Ideally a single sorter should be created and shared amongst all instances. This is already taken care of if you do not pass a custom sorter, a default sorter instance is re-used throughout.
The order of the default sorter can be changed without creating a new class by importing it early and changing it's order property.
The default class based implementation of the IKeysSorter interface.
Creates a keys sorter for shortcut chains.
Can either be passed some (object) enum of KeySortPos or it's keys with the values changed, for example:
They way this works is the enum should contain every possible combination of key "types". All sort does is determine the type and use it's position in the enum to know where to sort it. If two keys are of the same type, they are sorted alphabetically by their id.
Or you can extend from the class and implement a custom sort function.
Ideally a single sorter should be created and shared amongst all instances. This is already taken care of if you do not pass a custom sorter, a default sorter instance is re-used throughout.
The order of the default sorter can be changed without creating a new class by importing it early and changing it's
order
property.