Skip to content

A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol

add tab key for history handling on cardputer standalone mode

Geo30a3c364b83c
diff --git a/src/Inputs/CardputerInput.cpp b/src/Inputs/CardputerInput.cpp
index aa4db55d..dfda9f5c 100644
--- a/src/Inputs/CardputerInput.cpp
+++ b/src/Inputs/CardputerInput.cpp
@@ -76,20 +76,23 @@ char CardputerInput::readChar() {
// State change
if (!M5Cardputer.Keyboard.isChange()) return KEY_NONE;
if (!M5Cardputer.Keyboard.isPressed()) return KEY_NONE;
-
+
+ // ; . keys inversed
if (status.fn && M5Cardputer.Keyboard.isKeyPressed(KEY_ARROW_UP)) return KEY_ARROW_UP;
if (status.fn && M5Cardputer.Keyboard.isKeyPressed(KEY_ARROW_DOWN)) return KEY_ARROW_DOWN;
+
if (status.enter) return KEY_OK;
if (status.del) return KEY_DEL;
+ if (status.tab) return KEY_TAB_CUSTOM;
for (auto c : status.word) {
- delay(50); // debounce
+ delay(5); // debounce
// Issue with %, the only key that requires 2 inputs to display
if (c == '%') {
return '5';
}
- return c; // retourner le premier char saisi
+ return c; // return first char pressed
}
return KEY_NONE;
diff --git a/src/Inputs/InputKeys.h b/src/Inputs/InputKeys.h
index f4fa47fd..731b970f 100644
--- a/src/Inputs/InputKeys.h
+++ b/src/Inputs/InputKeys.h
@@ -10,6 +10,7 @@
#define KEY_ARROW_DOWN '.'
#define KEY_ARROW_LEFT ','
#define KEY_ARROW_RIGHT '/'
+#define KEY_TAB_CUSTOM '\t'
#define CARDPUTER_SPECIAL_ARROW_UP '^'
#define CARDPUTER_SPECIAL_ARROW_DOWN '`'