MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / formatKeyNameWithModifiers

Function formatKeyNameWithModifiers

packages/pi-tui/src/keys.ts:776–786  ·  view source on GitHub ↗
(keyName: string, modifier: number)

Source from the content-addressed store, hash-verified

774}
775
776function formatKeyNameWithModifiers(keyName: string, modifier: number): string | undefined {
777 const mods: string[] = [];
778 const effectiveMod = modifier & ~LOCK_MASK;
779 const supportedModifierMask = MODIFIERS.shift | MODIFIERS.ctrl | MODIFIERS.alt | MODIFIERS.super;
780 if ((effectiveMod & ~supportedModifierMask) !== 0) return undefined;
781 if (effectiveMod & MODIFIERS.shift) mods.push("shift");
782 if (effectiveMod & MODIFIERS.ctrl) mods.push("ctrl");
783 if (effectiveMod & MODIFIERS.alt) mods.push("alt");
784 if (effectiveMod & MODIFIERS.super) mods.push("super");
785 return mods.length > 0 ? `${mods.join("+")}+${keyName}` : keyName;
786}
787
788function parseKeyId(
789 keyId: string,

Callers 1

formatParsedKeyFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected