add ctrl+c ctrl+x and esc to mobile terminal ui

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2024-09-24 20:00:32 +01:00
parent bc34f140c8
commit 61fb6898c0
2 changed files with 29 additions and 0 deletions

View File

@ -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"

View File

@ -989,6 +989,9 @@
<div class="toright2"></div>
<div style="height:28px">
<input id="termActionsBtn" style="margin-left:3px;height:28px" type=button title="Perform power actions on the device" onkeypress="return false" onkeydown="return false" value=Actions onclick=deviceActionFunction() />
<input id="ctrlcbutton" style="margin-left:3px;height:28px" type=button onkeypress="return false" onkeydown="return false" value="Ctl-C" onclick="termSendKey(3,'ctrlcbutton')" />
<input id="ctrlxbutton" style="margin-left:3px;height:28px" type=button onkeypress="return false" onkeydown="return false" value="Ctl-X" onclick="termSendKey(24,'ctrlxbutton')" />
<input id="escbutton" style="margin-left:3px;height:28px" type=button onkeypress="return false" onkeydown="return false" value="ESC" onclick="termSendKey(27,'escbutton')" />
</div>
</div>
</div>
@ -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
//