MCPcopy
hub / github.com/editablejs/editable / create

Function create

packages/editor/src/utils/hotkeys.ts:64–78  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

62 */
63
64const create = (key: string) => {
65 const generic = HOTKEYS[key]
66 const apple = APPLE_HOTKEYS[key]
67 const windows = WINDOWS_HOTKEYS[key]
68 const isGeneric = generic && isKeyHotkey(generic)
69 const isApple = apple && isKeyHotkey(apple)
70 const isWindows = windows && isKeyHotkey(windows)
71
72 return (event: KeyboardEvent) => {
73 if (isGeneric && isGeneric(event)) return true
74 if (IS_APPLE && isApple && isApple(event)) return true
75 if (!IS_APPLE && isWindows && isWindows(event)) return true
76 return false
77 }
78}
79
80/**
81 * Hotkeys.

Callers 10

hotkeys.tsFile · 0.70
getDecorateStoreFunction · 0.50
getStoreFunction · 0.50
getDragStoreFunction · 0.50
getStoreFunction · 0.50
getStoreFunction · 0.50
getPlaceholderStoreFunction · 0.50
EditableProviderFunction · 0.50
getStoreFunction · 0.50
getStoreFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected