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

◆ on_mouse_pressed()

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

Schedule a mouse button press handler.

Parameters
windowWindow to listen to
buttonMouse button to wait for
callbackFunction to call on button press (x, y)
nameOptional name for the event handler

Example:

// Handle left mouse button press at (x, y)
}, "mouse_left_press_handler");
std::weak_ptr< Core::Window > window
Definition Picker.cpp:23
void on_mouse_pressed(const std::shared_ptr< Core::Window > &window, IO::MouseButtons button, std::function< void(double, double)> callback, std::string name)
Schedule a mouse button press handler.
Definition Chronie.cpp:197

Definition at line 197 of file Chronie.cpp.

202{
203 auto event_manager = get_event_manager();
204 if (name.empty()) {
205 name = "mouse_press_" + std::to_string(event_manager->get_next_event_id());
206 }
207
208 auto event = std::make_shared<Vruta::Event>(
209 Kriya::mouse_pressed(window, button, std::move(callback)));
210
211 event_manager->add_event(event, name);
212}
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_pressed(), 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: