diff --git a/include/gamepad/controller.hpp b/include/gamepad/controller.hpp index d7af3b1..7ba75ef 100644 --- a/include/gamepad/controller.hpp +++ b/include/gamepad/controller.hpp @@ -35,6 +35,9 @@ class Button { uint32_t onRelease(std::function func) const; uint32_t addListener(EventType event, std::function func) const; bool removeListener(uint32_t id) const; + explicit operator bool() const { + return is_pressed; + } private: void update(bool is_held);