exclude keys

pull/5370/head
ioedeveloper 5 years ago committed by Liana Husikyan
parent 5fbd497f5c
commit 89918e9cf3
  1. 9
      src/app/panels/terminal.js

@ -195,7 +195,7 @@ class Terminal extends Plugin {
</div>
`
self._view.term = yo`
<div class="${css.terminal_container}" tabindex="-1" data-id="terminalContainer" onscroll=${throttle(reattach, 10)} onkeypress=${focusinput}>
<div class="${css.terminal_container}" tabindex="-1" data-id="terminalContainer" onscroll=${throttle(reattach, 10)} onkeydown=${focusinput}>
${self._components.autoCompletePopup.render()}
<div class="bg-secondary" data-id="terminalContainerDisplay" style="
position: absolute;
@ -303,8 +303,13 @@ class Terminal extends Plugin {
})
function focusinput (event) {
refocus()
const excludeKeys = [16, 17, 18, 27, 37, 38, 39, 40, 91, 92]
if (!excludeKeys.includes(event.keyCode) && !(event.ctrlKey && event.keyCode)) {
refocus()
}
}
function refocus () {
self._view.input.focus()
reattach({ currentTarget: self._view.term })

Loading…
Cancel
Save