mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
add Linux telnet keys
This commit is contained in:
@@ -213,7 +213,7 @@ void Shell::loop_normal() {
|
||||
|
||||
default:
|
||||
if (esc_) {
|
||||
if (c == '[') {
|
||||
if ((c == '[') || (c == 'O')) {
|
||||
// start of sequence
|
||||
} else if (c >= '0' && (c <= '9')) {
|
||||
// numbers
|
||||
@@ -240,6 +240,22 @@ void Shell::loop_normal() {
|
||||
cursor_++;
|
||||
}
|
||||
esc_ = 0;
|
||||
} else if (c == 'H') {
|
||||
// Home
|
||||
cursor_ = line_buffer_.length();
|
||||
esc_ = 0;
|
||||
} else if (c == 'F') {
|
||||
// End
|
||||
cursor_ = 0;
|
||||
esc_ = 0;
|
||||
} else if (c == 'P') {
|
||||
// F1
|
||||
set_command_str(F("help"));
|
||||
esc_ = 0;
|
||||
} else if (c == 'Q') {
|
||||
// F2
|
||||
set_command_str(F("show"));
|
||||
esc_ = 0;
|
||||
} else if (c == '~') {
|
||||
// function keys with number
|
||||
if ((esc_ == 3) && cursor_) {
|
||||
@@ -262,8 +278,8 @@ void Shell::loop_normal() {
|
||||
// F9
|
||||
line_buffer_ = read_flash_string(F("send telegram \"0B \""));
|
||||
cursor_ = 1;
|
||||
} else if (esc_ == 21) {
|
||||
// F10
|
||||
} else if (esc_ == 15) {
|
||||
// F5
|
||||
set_command_str(F("call system report"));
|
||||
}
|
||||
esc_ = 0;
|
||||
|
||||
@@ -140,18 +140,14 @@ char * Helpers::render_enum(char * result, const std::vector<const __FlashString
|
||||
if (no >= value.size()) {
|
||||
return nullptr; // out of bounds
|
||||
}
|
||||
std::string str = uuid::read_flash_string(value[no]);
|
||||
if (bool_format() == BOOL_FORMAT_ONOFF) {
|
||||
strcpy(result, str.c_str());
|
||||
} else if (bool_format() == BOOL_FORMAT_TRUEFALSE) {
|
||||
strcpy(result, uuid::read_flash_string(value[no]).c_str());
|
||||
if (bool_format() == BOOL_FORMAT_TRUEFALSE) {
|
||||
if (no == 0 && uuid::read_flash_string(value[0]) == "off") {
|
||||
strlcpy(result, "false", 7);
|
||||
} else if (no == 1 && uuid::read_flash_string(value[1]) == "on") {
|
||||
strlcpy(result, "true", 6);
|
||||
} else {
|
||||
strcpy(result, str.c_str());
|
||||
}
|
||||
} else {
|
||||
} else if (bool_format() == BOOL_FORMAT_NUMBERS) {
|
||||
itoa(result, no);
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#define BOOL_FORMAT_ONOFF 1
|
||||
#define BOOL_FORMAT_TRUEFALSE 2
|
||||
#define BOOL_FORMAT_NUMBERS 3
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user