mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
don't use unicode characters for shortcut help (#1565)
* don't use unicode characters for shortcut help * use option instead of alt * make shortcut replacement case-insensitive * improve shortcut dialog layout
This commit is contained in:
parent
394237728f
commit
a90ca5eb84
2 changed files with 46 additions and 42 deletions
12
src/utils.ts
12
src/utils.ts
|
@ -158,14 +158,12 @@ export const getShortcutKey = (shortcut: string): string => {
|
|||
const isMac = /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
||||
if (isMac) {
|
||||
return `${shortcut
|
||||
.replace("CtrlOrCmd+", "⌘")
|
||||
.replace("Alt+", "⌥")
|
||||
.replace("Ctrl+", "⌃")
|
||||
.replace("Shift+", "⇧")
|
||||
.replace("Del", "⌫")
|
||||
.replace(/Enter|Return/, "↩")}`;
|
||||
.replace(/CtrlOrCmd/i, "Cmd")
|
||||
.replace(/Alt/i, "Option")
|
||||
.replace(/Del/i, "Delete")
|
||||
.replace(/Enter|Return/i, "Enter")}`;
|
||||
}
|
||||
return `${shortcut.replace("CtrlOrCmd", "Ctrl")}`;
|
||||
return `${shortcut.replace(/CtrlOrCmd/i, "Ctrl")}`;
|
||||
};
|
||||
export function viewportCoordsToSceneCoords(
|
||||
{ clientX, clientY }: { clientX: number; clientY: number },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue