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

◆ on_mouse_move()

MAYAFLUX_API void MayaFlux::on_mouse_move ( const std::shared_ptr< Core::Window > &  window,
std::function< void(double, double)>  callback,
std::string  name = "" 
)

Schedule a mouse movement handler.

Parameters
windowWindow to listen to
callbackFunction to call on mouse move (x, y)
nameOptional name for the event handler

Example:

MayaFlux::on_mouse_move(window, [](double x, double y) {
// Handle mouse move at (x, y)
}, "mouse_move_handler");
void on_mouse_move(const std::shared_ptr< Core::Window > &window, std::function< void(double, double)> callback, std::string name)
Schedule a mouse movement handler.
Definition Chronie.cpp:209

Definition at line 209 of file Chronie.cpp.

213{
214 auto event_manager = get_event_manager();
215 if (name.empty()) {
216 name = "mouse_move_" + std::to_string(event_manager->get_next_event_id());
217 }
218
219 auto event = std::make_shared<Vruta::Event>(
220 Kriya::mouse_moved(window, std::move(callback)));
221
222 event_manager->add_event(event, name);
223}
std::shared_ptr< Vruta::EventManager > get_event_manager()
Gets the event manager from the default engine.
Definition Chronie.cpp:27

References get_event_manager(), and MayaFlux::Kriya::mouse_moved().

Referenced by bind_viewport_preset().

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