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