Struct ButtonPollState

Struct Documentation

struct ButtonPollState

State at one completed input poll; both edges may be true for a press and release in that poll.

Public Functions

inline bool held() const

Declaration: [[nodiscard]]

Return final held state; both edges can still be true after a same-poll tap.

inline bool pressed() const

Declaration: [[nodiscard]]

Return whether one or more press transitions occurred, not only the final level.

inline bool released() const

Declaration: [[nodiscard]]

Return whether one or more release transitions occurred, independently of press presence.

Public Members

bool current = false

Final held state at this publication.

bool previous = false

Held state from the preceding publication.

bool pressed_this_poll = false

At least one semantic press in this poll.

bool released_this_poll = false

At least one semantic release in this poll.

std::uint64_t press_count = 0

Number of retained press transitions in this poll.

std::uint64_t release_count = 0

Number of retained release transitions in this poll.

std::optional<CE::Input::ObservationClock::time_point> hold_started_at

Observed start of an active hold; absent when released.

std::vector<CE::Input::ObservationDuration> completed_holds

Owned full durations of holds released during this poll, in observation seconds.