From 2aebb468230943c033e28fa64c8ab1bdfe98e8c2 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 11 May 2022 17:33:32 -0500 Subject: [PATCH] basic button support --- src/Watchy.cpp | 14 ++++++++++++++ src/Watchy.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/src/Watchy.cpp b/src/Watchy.cpp index 98e94e3..d391f6c 100644 --- a/src/Watchy.cpp +++ b/src/Watchy.cpp @@ -114,6 +114,7 @@ void Watchy::handleButtonPress() { } else if (guiState == FW_UPDATE_STATE) { showMenu(menuIndex, false); // exit to menu if already in app } else if (guiState == WATCHFACE_STATE) { + button1(); return; } } @@ -126,6 +127,7 @@ void Watchy::handleButtonPress() { } showMenu(menuIndex, true); } else if (guiState == WATCHFACE_STATE) { + button2(); return; } } @@ -138,6 +140,7 @@ void Watchy::handleButtonPress() { } showMenu(menuIndex, true); } else if (guiState == WATCHFACE_STATE) { + button3(); return; } } @@ -579,6 +582,17 @@ void Watchy::drawWatchFace() { display.println(currentTime.Minute); } +void Watchy::button1() +{ +} +void Watchy::button2() +{ +} +void Watchy::button3() +{ +} + + weatherData Watchy::getWeatherData() { return getWeatherData(settings.cityID, settings.weatherUnit, settings.weatherLang, settings.weatherURL, diff --git a/src/Watchy.h b/src/Watchy.h index 43fa9ae..c745a59 100644 --- a/src/Watchy.h +++ b/src/Watchy.h @@ -73,6 +73,9 @@ public: void showWatchFace(bool partialRefresh); virtual void drawWatchFace(); // override this method for different watch // faces + virtual void button1(); // override these methods to handle different non-menu button presses + virtual void button2(); + virtual void button3(); private: void _bmaConfig();