|
|
@@ -1,5 +1,6 @@
|
|
|
#include "cli_shared_methods.h"
|
|
|
#include <cli/cli.h>
|
|
|
+#include <cli/cli_ansi.h>
|
|
|
#include <lib/toolbox/args.h>
|
|
|
#include "cli_helpers.h"
|
|
|
#include "../types/plugin_event.h"
|
|
|
@@ -35,13 +36,13 @@ void totp_cli_force_close_app(void* ctx) {
|
|
|
bool totp_cli_read_line(Cli* cli, FuriString* out_str, bool mask_user_input) {
|
|
|
uint8_t c;
|
|
|
while(cli_read(cli, &c, 1) == 1) {
|
|
|
- if(c == CliSymbolAsciiEsc) {
|
|
|
+ if(c == CliKeyEsc) {
|
|
|
// Some keys generating escape-sequences
|
|
|
// We need to ignore them as we care about alpha-numerics only
|
|
|
uint8_t c2;
|
|
|
cli_read_timeout(cli, &c2, 1, 0);
|
|
|
cli_read_timeout(cli, &c2, 1, 0);
|
|
|
- } else if(c == CliSymbolAsciiETX) {
|
|
|
+ } else if(c == CliKeyETX) {
|
|
|
cli_nl(cli);
|
|
|
return false;
|
|
|
} else if(
|
|
|
@@ -54,13 +55,13 @@ bool totp_cli_read_line(Cli* cli, FuriString* out_str, bool mask_user_input) {
|
|
|
}
|
|
|
fflush(stdout);
|
|
|
furi_string_push_back(out_str, c);
|
|
|
- } else if(c == CliSymbolAsciiBackspace || c == CliSymbolAsciiDel) {
|
|
|
+ } else if(c == CliKeyBackspace || c == CliKeyDEL) {
|
|
|
size_t out_str_size = furi_string_size(out_str);
|
|
|
if(out_str_size > 0) {
|
|
|
TOTP_CLI_DELETE_LAST_CHAR();
|
|
|
furi_string_left(out_str, out_str_size - 1);
|
|
|
}
|
|
|
- } else if(c == CliSymbolAsciiCR) {
|
|
|
+ } else if(c == CliKeyCR) {
|
|
|
cli_nl(cli);
|
|
|
break;
|
|
|
}
|