From 7f13457bab2d950f2b84886fc26ca757164ab4ef Mon Sep 17 00:00:00 2001 From: eadmaster <925171+eadmaster@users.noreply.github.com> Date: Sun, 21 Jul 2024 04:21:12 +0200 Subject: [PATCH] addedmain menu shortcuts (#64) --- src/main.cpp | 2 ++ src/mykeyboard.cpp | 16 ++++++++++++++++ src/mykeyboard.h | 4 +++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 5dc89488..65920f44 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -193,6 +193,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--; diff --git a/src/mykeyboard.cpp b/src/mykeyboard.cpp index 02ade134..49efda8d 100644 --- a/src/mykeyboard.cpp +++ b/src/mykeyboard.cpp @@ -59,6 +59,22 @@ bool checkEscPress(){ else { return false; } } +#include "TV-B-Gone.h" +#include "rf.h" +#include "webInterface.h" + +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('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) { diff --git a/src/mykeyboard.h b/src/mykeyboard.h index 8c0436fe..4de25106 100644 --- a/src/mykeyboard.h +++ b/src/mykeyboard.h @@ -10,4 +10,6 @@ bool checkPrevPress(); bool checkSelPress(); -bool checkEscPress(); \ No newline at end of file +bool checkEscPress(); + +void checkShortcutPress();