From df4c75b3700c2a436a1d2725ecce8fc90999beb2 Mon Sep 17 00:00:00 2001 From: cpsdqs Date: Wed, 20 Sep 2017 20:55:19 +0200 Subject: [PATCH] Handle all received keydown keys in soft input and also fix #189 --- js/soft_keyboard.js | 9 ++------- js/term_input.js | 4 +++- 2 files changed, 5 insertions(+), 8 deletions(-) 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 }