| 774 | } |
| 775 | |
| 776 | function 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 | |
| 788 | function parseKeyId( |
| 789 | keyId: string, |