From b6b01054316648b45c948050048914f4e62baece Mon Sep 17 00:00:00 2001 From: rudnovd Date: Sat, 26 Nov 2022 13:52:17 +0500 Subject: [PATCH] feat(components): handle hotkeys by event.code --- .../src/features/components/ComponentsInspector.vue | 6 +++--- .../src/features/components/SelectedComponentPane.vue | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/app-frontend/src/features/components/ComponentsInspector.vue b/packages/app-frontend/src/features/components/ComponentsInspector.vue index 9e44129d5..29db19397 100644 --- a/packages/app-frontend/src/features/components/ComponentsInspector.vue +++ b/packages/app-frontend/src/features/components/ComponentsInspector.vue @@ -42,16 +42,16 @@ export default defineComponent({ } = useComponentPick() onKeyDown(event => { - if (event.key === 'f' && event.altKey) { + if (event.code === 'KeyF' && event.altKey) { treeFilterInput.value.focus() return false - } else if (event.key === 's' && event.altKey && !pickingComponent.value) { + } else if (event.code === 'KeyS' && event.altKey && !pickingComponent.value) { startPickingComponent() return false } else if (event.key === 'Escape' && pickingComponent.value) { stopPickingComponent() return false - } else if (event.key === 'r' && (event.ctrlKey || event.metaKey) && event.altKey) { + } else if (event.code === 'KeyR' && (event.ctrlKey || event.metaKey) && event.altKey) { refresh() return false } diff --git a/packages/app-frontend/src/features/components/SelectedComponentPane.vue b/packages/app-frontend/src/features/components/SelectedComponentPane.vue index d11d93053..62f07c2a7 100644 --- a/packages/app-frontend/src/features/components/SelectedComponentPane.vue +++ b/packages/app-frontend/src/features/components/SelectedComponentPane.vue @@ -33,7 +33,7 @@ export default defineComponent({ // State filter const stateFilterInput = ref() onKeyDown(event => { - if (event.key === 'd' && event.altKey) { + if (event.code === 'KeyD' && event.altKey) { stateFilterInput.value.focus() return false }