MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / normalizeKey

Function normalizeKey

src/lib/keyBindings.js:681–688  ·  view source on GitHub ↗
(key, platform = "win")

Source from the content-addressed store, hash-verified

679}
680
681function normalizeKey(key, platform = "win") {
682 if (!key) return null;
683 const replaced = key.replace(/Mod/g, platform === "mac" ? "Cmd" : "Ctrl");
684 const { modifiers, baseKey } = parseKeyParts(replaced);
685 if (!baseKey) return [...modifiers].join("-") || null;
686 const ordered = MODIFIER_ORDER.filter((mod) => modifiers.has(mod));
687 return [...ordered, baseKey].join("-");
688}
689
690function ensureModifier(combo, modifier) {
691 if (!combo) return null;

Callers 2

pushCommandComboFunction · 0.85

Calls 1

parseKeyPartsFunction · 0.85

Tested by

no test coverage detected