192{
194 std::make_shared<Vruta::Event>(
196 [
this](
double px,
double py) {
handle_move(px, py); })),
198
200 std::make_shared<Vruta::Event>(
204
206 std::make_shared<Vruta::Event>(
209 m_name +
"_release_left");
210
212 std::make_shared<Vruta::Event>(
216
218 std::make_shared<Vruta::Event>(
221 m_name +
"_release_right");
222
224 std::make_shared<Vruta::Event>(
228
230 std::make_shared<Vruta::Event>(
234
236 std::make_shared<Vruta::Event>(
240}
void handle_move(double px, double py)
Vruta::EventManager & m_event_manager
std::shared_ptr< Core::Window > m_window
void handle_release(double px, double py, IO::MouseButtons btn)
void handle_drag(double px, double py, IO::MouseButtons btn)
void handle_press(double px, double py, IO::MouseButtons btn)
void handle_scroll(double dx, double dy)
void add_event(const std::shared_ptr< Event > &event, const std::string &name="")
Add a event to the manager.
Vruta::Event mouse_moved(std::shared_ptr< Core::Window > window, std::function< void(double, double)> callback)
Creates an Event coroutine that triggers on mouse movement.
Vruta::Event mouse_scrolled(std::shared_ptr< Core::Window > window, std::function< void(double, double)> callback)
Creates an Event coroutine that triggers on mouse scroll.
Vruta::Event mouse_released(std::shared_ptr< Core::Window > window, IO::MouseButtons button, std::function< void(double, double)> callback)
Creates an Event coroutine that triggers on specific mouse button release.
Vruta::Event mouse_pressed(std::shared_ptr< Core::Window > window, IO::MouseButtons button, std::function< void(double, double)> callback)
Creates an Event coroutine that triggers on specific mouse button press.
Vruta::Event mouse_dragged(std::shared_ptr< Core::Window > window, IO::MouseButtons button, std::function< void(double, double)> callback)
Creates an Event coroutine that triggers on mouse drag with specific button.