MayaFlux 1.0.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");
std::weak_ptr< Core::Window > window
Definition Picker.cpp:23
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:231

Definition at line 231 of file Chronie.cpp.

235{
236 auto event_manager = get_event_manager();
237 if (name.empty()) {
238 name = "mouse_move_" + std::to_string(event_manager->get_next_event_id());
239 }
240
241 auto event = std::make_shared<Vruta::Event>(
242 Kriya::mouse_moved(window, std::move(callback)));
243
244 event_manager->add_event(event, name);
245}
PickCallback callback
Definition Picker.cpp:22
std::string name
Definition VKDevice.cpp:123
std::shared_ptr< Vruta::EventManager > get_event_manager()
Gets the event manager from the default engine.
Definition Chronie.cpp:27

References callback, get_event_manager(), MayaFlux::Kriya::mouse_moved(), name, and window.

Referenced by bind_fly_preset(), bind_orbit_preset(), bind_pan_zoom_preset(), and bind_screenspace_preset().

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