|
|
@ -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 = '' |
|
|
|