MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / normalizeKeymapOverrides

Function normalizeKeymapOverrides

packages/app-core/src/lib/keymaps.ts:1352–1364  ·  view source on GitHub ↗
(input: unknown)

Source from the content-addressed store, hash-verified

1350}
1351
1352export function normalizeKeymapOverrides(input: unknown): KeymapOverrides {
1353 if (!input || typeof input !== "object") return {};
1354 const overrides: KeymapOverrides = {};
1355 for (const definition of KEYMAP_DEFINITIONS) {
1356 const raw = (input as Record<string, unknown>)[definition.id];
1357 if (typeof raw !== "string") continue;
1358 const normalized = normalizeKeymapBinding(definition.id, raw);
1359 if (normalized && normalized !== definition.defaultBinding) {
1360 overrides[definition.id] = normalized;
1361 }
1362 }
1363 return overrides;
1364}
1365
1366export function shortcutBindingFromEvent(event: KeyboardEvent): string | null {
1367 const mac = isMacPlatform();

Callers 1

normalizePrefsFunction · 0.90

Calls 1

normalizeKeymapBindingFunction · 0.85

Tested by

no test coverage detected