Make cfg.no_keys work properly

box-drawing
cpsdqs 7 years ago
parent 0b39d19276
commit 310033b911
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 2
      js/term/input.js

@ -247,6 +247,7 @@ module.exports = function (conn, screen) {
} }
const shouldAcceptEvent = function () { const shouldAcceptEvent = function () {
if (cfg.no_keys) return false
if (document.activeElement instanceof window.HTMLTextAreaElement) return false if (document.activeElement instanceof window.HTMLTextAreaElement) return false
return true return true
} }
@ -298,7 +299,6 @@ module.exports = function (conn, screen) {
// This takes care of text characters typed // This takes care of text characters typed
window.addEventListener('keypress', function (evt) { window.addEventListener('keypress', function (evt) {
if (!shouldAcceptEvent()) return if (!shouldAcceptEvent()) return
if (cfg.no_keys) return
if (evt.ctrlKey || evt.metaKey) return if (evt.ctrlKey || evt.metaKey) return
let str = '' let str = ''

Loading…
Cancel
Save