MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ press_flip()

auto MayaFlux::Portal::Forma::Geometry::press_flip ( IO::MouseButtons  btn = IO::MouseButtons::Left)
inline

Produce a Form::wire that registers a press flipping a bool state.

Definition at line 85 of file FormFactory.hpp.

86{
87 return [btn](Context& ctx, uint32_t id, std::shared_ptr<MappedState<bool>> state) {
88 ctx.on_press(id, btn, [state = std::move(state)](uint32_t, glm::vec2) {
89 state->write(!state->value);
90 });
91 };
92}
void on_press(uint32_t id, IO::MouseButtons btn, PressFn fn)
Called when a mouse button is pressed over an element.
Definition Context.cpp:33
Event wiring between a Layer and a window surface.
Definition Context.hpp:40

References MayaFlux::Portal::Forma::Context::on_press().

Referenced by toggle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: