|
|
|
@ -582,6 +582,8 @@ const toggleVisibility = async (checked: boolean, field: Field) => {
|
|
|
|
|
|
|
|
|
|
useEventListener(document, 'keydown', async (e: KeyboardEvent) => { |
|
|
|
|
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey |
|
|
|
|
const altOrOptionKey = e.altKey |
|
|
|
|
|
|
|
|
|
if (cmdOrCtrl) { |
|
|
|
|
switch (e.key.toLowerCase()) { |
|
|
|
|
case 's': |
|
|
|
@ -590,6 +592,15 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
|
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (altOrOptionKey) { |
|
|
|
|
switch (e.key.toLowerCase()) { |
|
|
|
|
case 'c': |
|
|
|
|
if (openedViewsTab.value !== 'field') return |
|
|
|
|
e.preventDefault() |
|
|
|
|
addField() |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
onKeyDown('ArrowDown', () => { |
|
|
|
@ -633,16 +644,6 @@ onKeyDown('ArrowRight', () => {
|
|
|
|
|
|
|
|
|
|
const keys = useMagicKeys() |
|
|
|
|
|
|
|
|
|
whenever(keys.altleft_c, () => { |
|
|
|
|
if (!meta.value?.id) return |
|
|
|
|
if (openedViewsTab.value === 'field') addField() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
whenever(keys.option_c, () => { |
|
|
|
|
if (!meta.value?.id) return |
|
|
|
|
if (openedViewsTab.value === 'field') addField() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
whenever(keys.meta_s, () => { |
|
|
|
|
if (!meta.value?.id) return |
|
|
|
|
if (openedViewsTab.value === 'field') saveChanges() |
|
|
|
|