From 61fb6898c0424b29bee5c91a1faa350d85e5b741 Mon Sep 17 00:00:00 2001 From: si458 Date: Tue, 24 Sep 2024 20:00:32 +0100 Subject: [PATCH] add ctrl+c ctrl+x and esc to mobile terminal ui Signed-off-by: si458 --- translate/translate.json | 3 +++ views/default-mobile.handlebars | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/translate/translate.json b/translate/translate.json index 4c0b1449..455cd7e5 100644 --- a/translate/translate.json +++ b/translate/translate.json @@ -21564,6 +21564,7 @@ "zh-cht": "Ctl-C", "uk": "Ctl-C", "xloc": [ + "default-mobile.handlebars->container->page_content->column_l->p10->p10terminal->termTable->termarea4->1->3", "default.handlebars->container->column_l->p12->termTable->1->1->4->1->3", "sharing.handlebars->p12->9->3" ] @@ -21594,6 +21595,7 @@ "zh-cht": "Ctl-X", "uk": "Ctl-X", "xloc": [ + "default-mobile.handlebars->container->page_content->column_l->p10->p10terminal->termTable->termarea4->1->3", "default.handlebars->container->column_l->p12->termTable->1->1->4->1->3", "sharing.handlebars->p12->9->3" ] @@ -28451,6 +28453,7 @@ "zh-cht": "ESC", "uk": "ESC", "xloc": [ + "default-mobile.handlebars->container->page_content->column_l->p10->p10terminal->termTable->termarea4->1->3", "default.handlebars->container->column_l->p11->deskarea0->deskarea4->5", "default.handlebars->container->column_l->p12->termTable->1->1->4->1->3", "sharing.handlebars->p12->9->3" diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index c449a28d..fc316db2 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -989,6 +989,9 @@
+ + +
@@ -5148,6 +5151,9 @@ // Enable action button if mesh type is not "local devices" QV('termActionsBtn', terminalNode.mtype != 3); + QE('ctrlcbutton', termState); + QE('ctrlxbutton', termState); + QE('escbutton', termState); if (((termState == true) && (terminal.contype != 3)) || (terminalNode.agent == null) || (terminalNode.agent.id == 3) || (terminalNode.agent.id == 4)) { QH('terminalCustomUpperRight', ''); } else { @@ -5467,6 +5473,26 @@ Q('connectbutton2').blur(); // Deselect the connect button so the button does not get key presses. } + function termSendKey(key, id) { + if (!terminal || xxdialogMode) return; + if (xterm != null) { + if (terminal.urlname == 'sshterminalrelay.ashx') { + // SSH + terminal.socket.send('~' + String.fromCharCode(key)); + } else if (terminal.sendText) { + // MeshAgent + terminal.sendText(String.fromCharCode(key)); + } else { + // CIRA + terminal.send(String.fromCharCode(key)); + } + xterm.focus(); + } else if (terminal != null) { + terminal.m.TermSendKey(key); + Q(id).blur(); // Deselect the connect button so the button does not get key presses. + } + } + // // Terminal Shortcut Keys //