MCPcopy Create free account
hub / github.com/pingdotgg/t3code / normalizeModifierKey

Function normalizeModifierKey

apps/web/src/shortcutModifierState.ts:57–73  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

55}
56
57function normalizeModifierKey(key: string): keyof ShortcutModifierState | null {
58 switch (key) {
59 case "Meta":
60 case "OS":
61 case "Command":
62 return "metaKey";
63 case "Control":
64 return "ctrlKey";
65 case "Alt":
66 case "Option":
67 return "altKey";
68 case "Shift":
69 return "shiftKey";
70 default:
71 return null;
72 }
73}
74
75export function shortcutModifierStateAfterKeyboardEvent(
76 currentState: ShortcutModifierState,

Calls

no outgoing calls

Tested by

no test coverage detected