178{
180 std::make_shared<Vruta::Event>(
182 [
this](
double px,
double py) {
handle_move(px, py); })),
184
186 std::make_shared<Vruta::Event>(
190
192 std::make_shared<Vruta::Event>(
195 m_name +
"_release_left");
196
198 std::make_shared<Vruta::Event>(
202
204 std::make_shared<Vruta::Event>(
207 m_name +
"_release_right");
208
210 std::make_shared<Vruta::Event>(
214
216 std::make_shared<Vruta::Event>(
220
222 std::make_shared<Vruta::Event>(
226}
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.