change copy/paste styles shortcuts (#1881)
* change copy/paste styles shortcuts * use keyCode
This commit is contained in:
parent
6f1cff101a
commit
df5eb3f0d9
@ -27,7 +27,9 @@ export const actionCopyStyles = register({
|
|||||||
},
|
},
|
||||||
contextItemLabel: "labels.copyStyles",
|
contextItemLabel: "labels.copyStyles",
|
||||||
keyTest: (event) =>
|
keyTest: (event) =>
|
||||||
event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === "C",
|
event[KEYS.CTRL_OR_CMD] &&
|
||||||
|
event.altKey &&
|
||||||
|
event.keyCode === KEYS.C_KEY_CODE,
|
||||||
contextMenuOrder: 0,
|
contextMenuOrder: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -67,6 +69,8 @@ export const actionPasteStyles = register({
|
|||||||
},
|
},
|
||||||
contextItemLabel: "labels.pasteStyles",
|
contextItemLabel: "labels.pasteStyles",
|
||||||
keyTest: (event) =>
|
keyTest: (event) =>
|
||||||
event[KEYS.CTRL_OR_CMD] && event.shiftKey && event.key === "V",
|
event[KEYS.CTRL_OR_CMD] &&
|
||||||
|
event.altKey &&
|
||||||
|
event.keyCode === KEYS.V_KEY_CODE,
|
||||||
contextMenuOrder: 1,
|
contextMenuOrder: 1,
|
||||||
});
|
});
|
||||||
|
@ -287,11 +287,11 @@ export const ShortcutsDialog = ({ onClose }: { onClose?: () => void }) => {
|
|||||||
/>
|
/>
|
||||||
<Shortcut
|
<Shortcut
|
||||||
label={t("labels.copyStyles")}
|
label={t("labels.copyStyles")}
|
||||||
shortcuts={[getShortcutKey("CtrlOrCmd+Shift+C")]}
|
shortcuts={[getShortcutKey("CtrlOrCmd+Alt+C")]}
|
||||||
/>
|
/>
|
||||||
<Shortcut
|
<Shortcut
|
||||||
label={t("labels.pasteStyles")}
|
label={t("labels.pasteStyles")}
|
||||||
shortcuts={[getShortcutKey("CtrlOrCmd+Shift+V")]}
|
shortcuts={[getShortcutKey("CtrlOrCmd+Alt+V")]}
|
||||||
/>
|
/>
|
||||||
<Shortcut
|
<Shortcut
|
||||||
label={t("labels.delete")}
|
label={t("labels.delete")}
|
||||||
|
@ -18,6 +18,8 @@ export const KEYS = {
|
|||||||
Z_KEY_CODE: 90,
|
Z_KEY_CODE: 90,
|
||||||
GRID_KEY_CODE: 222,
|
GRID_KEY_CODE: 222,
|
||||||
G_KEY_CODE: 71,
|
G_KEY_CODE: 71,
|
||||||
|
C_KEY_CODE: 67,
|
||||||
|
V_KEY_CODE: 86,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type Key = keyof typeof KEYS;
|
export type Key = keyof typeof KEYS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user