diff --git a/src/core/mykeyboard.cpp b/src/core/mykeyboard.cpp index bc259f7..68209e6 100644 --- a/src/core/mykeyboard.cpp +++ b/src/core/mykeyboard.cpp @@ -1,5 +1,9 @@ #include "mykeyboard.h" #include "powerSave.h" +#include "modules/others/TV-B-Gone.h" +#include "modules/rf/rf.h" +#include "modules/others/bad_usb.h" +#include "modules/others/webInterface.h" /* Verifies Upper Btn to go to previous item */ @@ -83,6 +87,32 @@ bool checkEscPress(){ else { return false; } } +bool checkAnyKeyPress() { +#if defined (CARDPUTER) // If any key is pressed, it'll jump the boot screen + Keyboard.update(); + if(Keyboard.isPressed()) + #else + if(digitalRead(SEL_BTN)==LOW) // If M5 key is pressed, it'll jump the boot screen + #endif + return true; + // else + return false; + +} + +void checkShortcutPress(){ + // some shortctus to quickly starts apps +#if defined (CARDPUTER) + Keyboard.update(); + if(Keyboard.isKeyPressed('i')) otherIRcodes(); + if(Keyboard.isKeyPressed('r') || Keyboard.isKeyPressed('s')) otherRFcodes(); + if(Keyboard.isKeyPressed('b')) usb_setup(); // badusb + if(Keyboard.isKeyPressed('w')) loopOptionsWebUi(); +// TODO: other boards +// TODO: user-configurable +#endif +} + #ifndef STICK_C /* Starts keyboard to type data */ String keyboard(String mytext, int maxSize, String msg) { @@ -570,4 +600,4 @@ String keyboard(String mytext, int maxSize, String msg) { } -#endif //If not STICK_C \ No newline at end of file +#endif //If not STICK_C diff --git a/src/core/mykeyboard.h b/src/core/mykeyboard.h index 19e5f9e..8f5e60e 100644 --- a/src/core/mykeyboard.h +++ b/src/core/mykeyboard.h @@ -10,4 +10,8 @@ bool checkPrevPress(); bool checkSelPress(); -bool checkEscPress(); \ No newline at end of file +bool checkEscPress(); + +void checkShortcutPress(); + +bool checkAnyKeyPress(); diff --git a/src/main.cpp b/src/main.cpp index 4d3d066..b3a10d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -253,6 +253,8 @@ void loop() { delay(200); } + checkShortcutPress(); // shortctus to quickly start apps without navigating the menus + if (checkPrevPress()) { if(index==0) index = opt - 1; else if(index>0) index--;