MCPcopy
hub / github.com/plait-board/drawnix / getShortcutKey

Function getShortcutKey

packages/drawnix/src/utils/common.ts:82–93  ·  view source on GitHub ↗
(shortcut: string)

Source from the content-addressed store, hash-verified

80};
81
82export const getShortcutKey = (shortcut: string): string => {
83 shortcut = shortcut
84 .replace(/\bAlt\b/i, "Alt")
85 .replace(/\bShift\b/i, "Shift")
86 .replace(/\b(Enter|Return)\b/i, "Enter");
87 if (IS_APPLE || IS_MAC) {
88 return shortcut
89 .replace(/\bCtrlOrCmd\b/gi, "Cmd")
90 .replace(/\bAlt\b/i, "Option");
91 }
92 return shortcut.replace(/\bCtrlOrCmd\b/gi, "Ctrl");
93};

Callers 5

SaveToFileFunction · 0.90
SaveAsImageFunction · 0.90
CleanBoardFunction · 0.90
MoreOptionsButtonFunction · 0.90
TTDDialogSubmitShortcutFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected