#pragma once #include "tft_handler.h" #include "event_manager.h" #include "GLOBALS.h" #include "icons.h" #include class InputManager { private: short BUTTON_PINS[6] = {4, 5, 6, 7, 17, 16}; static constexpr short NUM_BUTTONS = 6; short lastButtonState[NUM_BUTTONS] = {HIGH, HIGH, HIGH, HIGH, HIGH, HIGH}; short buttonState[NUM_BUTTONS] = {HIGH, HIGH, HIGH, HIGH, HIGH, HIGH}; const unsigned long DEBOUNCE_DELAY = 25; // milliseconds unsigned long lastDebounceTime[NUM_BUTTONS] = {0}; DISPLAY_STATE* _display_state; TFT_Handler* _tf; Mouse_Icon mi; void handle_keyboard_input(char key); void handle_button_press(short buttonIndex); bool are_buttons_pressed(short btn1, short btn2); public: void init(DISPLAY_STATE* display_state, TFT_Handler* tf); void update(); void draw_button(); };