Public Access
key command: del and tab
The serial and Debug Console `key` command could type characters but not erase them, so text typed into a field by mistake couldn't be cleared remotely. `key del` and `key tab` inject Delete and Tab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
+4
-3
@@ -325,7 +325,7 @@ static const char* const kHelp =
|
||||
"log level <0-5> ESP-IDF log level (0 none ... 5 verbose)\n"
|
||||
"crash the last crash: firmware, reason, task, backtrace\n"
|
||||
"coredump erase forget the core dump in flash\n"
|
||||
"key <name|char> press a key: up down left right select back home, or one character\n"
|
||||
"key <name|char> press a key: up down left right select back home del tab, or one character\n"
|
||||
"wifi status | wifi add <ssid><TAB><password>\n"
|
||||
"irc start | irc dump | irc say <buffer> <text>\n"
|
||||
"ls [folder] | rm <path> | install <path.ota> (Update from SD)\n"
|
||||
@@ -394,10 +394,11 @@ static void runCommand(String line) {
|
||||
if (line == "burst")
|
||||
for (int i = 1; i <= 5; i++)
|
||||
bus.publish(Event::withText(EventType::Notification, ("Burst " + String(i)).c_str(), 0));
|
||||
if (line.startsWith("key ")) { // key up|down|left|right|select|back|home
|
||||
if (line.startsWith("key ")) { // key up|down|left|right|select|back|home|del|tab
|
||||
String k = line.substring(4);
|
||||
Key key = k == "up" ? Key::Up : k == "down" ? Key::Down : k == "left" ? Key::Left
|
||||
: k == "right" ? Key::Right : k == "back" ? Key::Back : k == "home" ? Key::Home : Key::Select;
|
||||
: k == "right" ? Key::Right : k == "back" ? Key::Back : k == "home" ? Key::Home
|
||||
: k == "del" ? Key::Delete : k == "tab" ? Key::Tab : Key::Select;
|
||||
KeyEvent ev = k.length() == 1 && k[0] > ' ' ? KeyEvent::character((unsigned char)k[0]) : KeyEvent::of(key);
|
||||
if (!power->onKey(millis())) apps->handleKey(ev);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user