From b5aaf1294ffae5d1cc2e0afe62dcd4c94deecb6e Mon Sep 17 00:00:00 2001 From: Alexander Drozdov Date: Sat, 29 Jan 2022 00:10:45 +0200 Subject: [PATCH] dont allow F12 --- src/web/settings/HotkeyInput.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/web/settings/HotkeyInput.vue b/src/web/settings/HotkeyInput.vue index 39280338..e19a81a8 100644 --- a/src/web/settings/HotkeyInput.vue +++ b/src/web/settings/HotkeyInput.vue @@ -47,18 +47,17 @@ export default defineComponent({ let { code, ctrlKey, shiftKey, altKey } = e if (code.startsWith('Key')) { - code = code.substr('Key'.length) + code = code.substring('Key'.length) } else if (code.startsWith('Digit')) { - code = code.substr('Digit'.length) + code = code.substring('Digit'.length) } else if (e.key === 'Cancel' && code === 'Pause') { code = 'Cancel' } if ((KeyToCode as Record)[code]) { code = hotkeyToString([code], ctrlKey, shiftKey, altKey) - if (props.noModKeys && code.includes('+')) { - return - } + if (code.includes('F12')) return + if (props.noModKeys && code.includes('+')) return ctx.emit('update:modelValue', code) } }