MCPcopy Create free account
hub / github.com/TanStack/hotkeys / normalizeHotkeyFromEvent

Function normalizeHotkeyFromEvent

packages/hotkeys/src/parse.ts:292–297  ·  view source on GitHub ↗
(
  event: KeyboardEvent,
  platform: 'mac' | 'windows' | 'linux' = detectPlatform(),
)

Source from the content-addressed store, hash-verified

290 * @param platform - Target platform for `Mod` eligibility
291 */
292export function normalizeHotkeyFromEvent(
293 event: KeyboardEvent,
294 platform: 'mac' | 'windows' | 'linux' = detectPlatform(),
295): Hotkey {
296 return normalizedHotkeyStringFromParsed(parseKeyboardEvent(event), platform)
297}
298
299/**
300 * Checks if a hotkey or ParsedHotkey contains at least one non-modifier key.

Callers 2

hotkeyChordFromKeydownFunction · 0.90
parse.test.tsFile · 0.90

Calls 3

detectPlatformFunction · 0.90
parseKeyboardEventFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…