Button.h 367 B

123456789101112131415161718192021222324
  1. #ifndef BUTTON_H
  2. #define BUTTON_H
  3. class Button final {
  4. friend class Buttons;
  5. int key;
  6. int downTime;
  7. bool released;
  8. const char* name;
  9. public:
  10. Button(int key, const char* name);
  11. bool isDown() const;
  12. int getDownTime() const;
  13. bool wasReleased() const;
  14. const char* getName() const;
  15. private:
  16. void tick(bool down);
  17. };
  18. #endif