From 335b5b9ba4a9e842bf921f24ebd10c2e8d26cb6b Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 25 Mar 2020 09:18:09 +0000 Subject: [PATCH] changed logic for excluding special keys --- src/app/panels/terminal.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index a3dc95a8c0..36fb221572 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -303,11 +303,24 @@ class Terminal extends Plugin { }) function focusinput (event) { - const excludeKeys = [16, 17, 18, 27, 37, 38, 39, 40, 91, 92] + if ( + event.altKey || + event.ctrlKey || + event.metaKey || + event.shiftKey || + event.key === 'Down' || + event.key === 'ArrowDown' || + event.key === 'Up' || + event.key === 'ArrowUp' || + event.key === 'Left' || + event.key === 'ArrowLeft' || + event.key === 'Right' || + event.key === 'ArrowRight' || + event.key === 'Esc' || + event.key === 'Escape' + ) return - if (!excludeKeys.includes(event.keyCode) && !(event.ctrlKey && event.keyCode)) { - refocus() - } + refocus() } function refocus () {