diff --git a/totp/cli/cli_shared_methods.c b/totp/cli/cli_shared_methods.c index 1857bea2e..0b904f5f3 100644 --- a/totp/cli/cli_shared_methods.c +++ b/totp/cli/cli_shared_methods.c @@ -35,13 +35,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 +54,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; } diff --git a/totp/cli/cli_shared_methods.h b/totp/cli/cli_shared_methods.h index d2d287c87..e14dd0b46 100644 --- a/totp/cli/cli_shared_methods.h +++ b/totp/cli/cli_shared_methods.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include "../types/plugin_state.h" #ifdef __cplusplus diff --git a/totp/cli/plugins/delete/delete.c b/totp/cli/plugins/delete/delete.c index f417c944a..a8354a20f 100644 --- a/totp/cli/plugins/delete/delete.c +++ b/totp/cli/plugins/delete/delete.c @@ -56,10 +56,10 @@ static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) { char user_pick; do { user_pick = tolower(cli_getc(cli)); - } while(user_pick != 'y' && user_pick != 'n' && user_pick != CliSymbolAsciiCR && - user_pick != CliSymbolAsciiETX && user_pick != CliSymbolAsciiEsc); + } while(user_pick != 'y' && user_pick != 'n' && user_pick != CliKeyCR && + user_pick != CliKeyETX && user_pick != CliKeyEsc); - confirmed = user_pick == 'y' || user_pick == CliSymbolAsciiCR; + confirmed = user_pick == 'y' || user_pick == CliKeyCR; } if(confirmed) { diff --git a/totp/cli/plugins/pin/pin.c b/totp/cli/plugins/pin/pin.c index de17f4b26..2b4c1d5b0 100644 --- a/totp/cli/plugins/pin/pin.c +++ b/totp/cli/plugins/pin/pin.c @@ -42,7 +42,7 @@ static bool totp_cli_read_pin(Cli* cli, uint8_t* pin, uint8_t* pin_length) { uint8_t c; *pin_length = 0; while(cli_read(cli, &c, 1) == 1) { - if(c == CliSymbolAsciiEsc) { + if(c == CliKeyEsc) { uint8_t c2; uint8_t c3; if(cli_read_timeout(cli, &c2, 1, 0) == 1 && cli_read_timeout(cli, &c3, 1, 0) == 1 && @@ -55,17 +55,17 @@ static bool totp_cli_read_pin(Cli* cli, uint8_t* pin, uint8_t* pin_length) { fflush(stdout); } } - } else if(c == CliSymbolAsciiETX) { + } else if(c == CliKeyETX) { TOTP_CLI_DELETE_CURRENT_LINE(); TOTP_CLI_PRINTF_INFO("Cancelled by user\r\n"); return false; - } else if(c == CliSymbolAsciiBackspace || c == CliSymbolAsciiDel) { + } else if(c == CliKeyBackspace || c == CliKeyDEL) { if(*pin_length > 0) { *pin_length = *pin_length - 1; pin[*pin_length] = 0; TOTP_CLI_DELETE_LAST_CHAR(); } - } else if(c == CliSymbolAsciiCR) { + } else if(c == CliKeyCR) { cli_nl(cli); break; }