diff --git a/js/soft_keyboard.js b/js/soft_keyboard.js index c1a37ab..a462180 100644 --- a/js/soft_keyboard.js +++ b/js/soft_keyboard.js @@ -65,13 +65,8 @@ module.exports = function (screen, input) { keyInput.value = '' - if (e.key === 'Backspace') { - e.preventDefault() - input.sendString('\b') - } else if (e.key === 'Enter') { - e.preventDefault() - input.sendString('\x0d') - } + e.stopPropagation() + input.handleKeyDown(e) }) keyInput.addEventListener('keypress', e => { diff --git a/js/term_input.js b/js/term_input.js index 33637ca..e4809ba 100644 --- a/js/term_input.js +++ b/js/term_input.js @@ -444,7 +444,9 @@ module.exports = function (conn, screen) { */ blockKeys (yes) { cfg.no_keys = yes - } + }, + + handleKeyDown } return input }