Update send/bring shortcuts and show them properly per operating… (#784)
* Show proper shortcuts * sort * Add shortcuts to bring/send * fix hotkeys matching greedily * Space * align zindex shortcuts with figma * switch to event.code & change Darwin shortcuts Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
11
src/utils.ts
11
src/utils.ts
@ -134,6 +134,17 @@ export function resetCursor() {
|
||||
document.documentElement.style.cursor = "";
|
||||
}
|
||||
|
||||
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+", "⇧")}`;
|
||||
}
|
||||
return ` — ${shortcut.replace("CtrlOrCmd", "Ctrl")}`;
|
||||
};
|
||||
export function viewportCoordsToSceneCoords(
|
||||
{ clientX, clientY }: { clientX: number; clientY: number },
|
||||
{
|
||||
|
Reference in New Issue
Block a user