Make pages relying on hotkeys more resilient

Reviewed by: @wraitii
Differential Revision: https://code.wildfiregames.com/D3541
This was SVN commit r24856.
This commit is contained in:
Stan
2021-02-08 13:56:40 +00:00
parent a4c698ac48
commit f222dd2d3e
@@ -27,6 +27,9 @@ function formatHotkeyCombination(comb, translateScancodes = true)
function formatHotkeyCombinations(combinations, translateScancodes = true)
{
if (!combinations || !combinations.length)
return "";
let combs = combinations.map(x => formatHotkeyCombination(x, translateScancodes));
combs.sort((a, b) => a.length - b.length || a - b);
return translateScancodes ? combs.join(", ") : combs;