mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fixes in Shortcuts dialog and minor refactor (#1297)
This commit is contained in:
parent
e4c154f43e
commit
0c3d34261e
11 changed files with 96 additions and 82 deletions
|
@ -161,17 +161,17 @@ export const allowFullScreen = () =>
|
|||
|
||||
export const exitFullScreen = () => document.exitFullscreen();
|
||||
|
||||
export const getShortcutKey = (shortcut: string, prefix = " — "): string => {
|
||||
export const getShortcutKey = (shortcut: string): string => {
|
||||
const isMac = /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
||||
if (isMac) {
|
||||
return `${prefix}${shortcut
|
||||
return `${shortcut
|
||||
.replace("CtrlOrCmd+", "⌘")
|
||||
.replace("Alt+", "⌥")
|
||||
.replace("Ctrl+", "⌃")
|
||||
.replace("Shift+", "⇧")
|
||||
.replace("Del", "⌫")}`;
|
||||
}
|
||||
return `${prefix}${shortcut.replace("CtrlOrCmd", "Ctrl")}`;
|
||||
return `${shortcut.replace("CtrlOrCmd", "Ctrl")}`;
|
||||
};
|
||||
export function viewportCoordsToSceneCoords(
|
||||
{ clientX, clientY }: { clientX: number; clientY: number },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue