Show shortcuts dialog when pressing ?
(#1224)
This commit is contained in:
@ -144,16 +144,17 @@ export function resetCursor() {
|
||||
document.documentElement.style.cursor = "";
|
||||
}
|
||||
|
||||
export const getShortcutKey = (shortcut: string): string => {
|
||||
export const getShortcutKey = (shortcut: string, prefix = " — "): string => {
|
||||
const isMac = /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
||||
if (isMac) {
|
||||
return ` — ${shortcut
|
||||
return `${prefix}${shortcut
|
||||
.replace("CtrlOrCmd+", "⌘")
|
||||
.replace("Alt+", "⌥")
|
||||
.replace("Ctrl+", "⌃")
|
||||
.replace("Shift+", "⇧")}`;
|
||||
.replace("Shift+", "⇧")
|
||||
.replace("Del", "⌫")}`;
|
||||
}
|
||||
return ` — ${shortcut.replace("CtrlOrCmd", "Ctrl")}`;
|
||||
return `${prefix}${shortcut.replace("CtrlOrCmd", "Ctrl")}`;
|
||||
};
|
||||
export function viewportCoordsToSceneCoords(
|
||||
{ clientX, clientY }: { clientX: number; clientY: number },
|
||||
|
Reference in New Issue
Block a user