@fabwcie/free-drawing / utils/shortcut
utils/shortcut
Functions
ariaShortcut()
ariaShortcut(...
shortcuts):string
Defined in: packages/free-drawing/src/utils/shortcut.ts:101
aria-keyshortcuts value of shortcuts: Ctrl is Meta (Cmd) on Apple devices, Control elsewhere
Parameters
shortcuts
...string[]
Keys separated by + (Ctrl+Shift+Up, Alt+L, Delete)
Returns
string
Shortcuts separated by spaces (Control+Shift+ArrowUp)
formatShortcut()
formatShortcut(
shortcut,t):string
Defined in: packages/free-drawing/src/utils/shortcut.ts:77
Shortcut as shown to the user: words in the language of the drawer, arrows; on Apple devices symbols of its keys in the order of macOS (Ctrl+Shift+Z: ⇧⌘Z, Ctrl+Click: ⌘+Click), Ctrl being Cmd there (shortcuts take both)
Parameters
shortcut
string
Keys separated by + (Ctrl+Shift+Up, Alt+Z, Delete, Shift+Arrows)
t
Translation function of the drawer
Returns
string
Text of the shortcut
isApple()
isApple():
boolean
Defined in: packages/free-drawing/src/utils/shortcut.ts:55
Device of Apple (macOS, iOS, iPadOS): shortcuts shown with the symbols of its keys (⌘, ⌥, ⇧)
Returns
boolean
true on an Apple device