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

◆ on() [4/7]

Wiring & MayaFlux::Nexus::Wiring::on ( std::shared_ptr< Core::Window window,
IO::MouseButtons  button,
bool  held,
std::function< void(double, double)>  on_release = nullptr 
)

Fire the entity on mouse-motion events while button is held.

Mirrors the key held overload. Cursor position is available via InfluenceContext on each qualifying event.

Parameters
windowSource window.
buttonButton that must be pressed for the entity to fire.
heldPass true to select the motion-while-held path.
on_releaseCalled when the button is released.

Definition at line 62 of file Wiring.cpp.

63{
64 m_trigger = MouseTrigger {
65 .window = std::move(window),
66 .button = button,
67 .on_release = on_release ? std::optional<std::function<void(double, double)>>(std::move(on_release)) : std::nullopt,
68 .held = held
69 };
70
71 return *this;
72}

References m_trigger, and MayaFlux::Nexus::Wiring::MouseTrigger::window.