MCPcopy
hub / github.com/jamiebuilds/tinykeys / tinykeys

Function tinykeys

src/tinykeys.ts:346–357  ·  view source on GitHub ↗
(
	target: Window | HTMLElement,
	keybindingMap: KeybindingsMap,
	options: KeybindingOptions = {},
)

Source from the content-addressed store, hash-verified

344 * ```
345 */
346export function tinykeys(
347 target: Window | HTMLElement,
348 keybindingMap: KeybindingsMap,
349 options: KeybindingOptions = {},
350): () => void {
351 let event = options.event ?? DEFAULT_EVENT
352 let onKeyEvent = createKeybindingsHandler(keybindingMap, options)
353 target.addEventListener(event, onKeyEvent, options.capture)
354 return () => {
355 target.removeEventListener(event, onKeyEvent, options.capture)
356 }
357}

Callers 2

index.tsxFile · 0.90
$tinykeysFunction · 0.85

Calls 1

createKeybindingsHandlerFunction · 0.85

Tested by 1

$tinykeysFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…