From 5aeb860aef49ddf00969ae4c5822b4a6cb94b61b Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Mon, 28 Oct 2024 12:25:03 +0000 Subject: [PATCH] enter-workaround quest 2 --- com/isoterminal/VT100.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/com/isoterminal/VT100.js b/com/isoterminal/VT100.js index 1282daf..6dd2e0d 100644 --- a/com/isoterminal/VT100.js +++ b/com/isoterminal/VT100.js @@ -1340,6 +1340,15 @@ VT100.prototype.setupTouchInputFallback = function(){ this.form.appendChild(this.input) this.scr_.parentElement.appendChild(this.form) + this.input.addEventListener('blur', () => { + if( this.input.value != '' ){ + ch = '\n' + this.key_buf_.push(ch); + setTimeout(VT100.go_getch_, 0); + this.input.value = '' + } + }) + this.input.addEventListener("keydown", VT100.handle_onkeypress_, false); this.input.handler = (e) => {