mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibWeb: Add internals.mouseDown(x, y)
This triggers a mouse button press without the up event, allowing us to e.g. simulate a selection by moving the mouse while keeping the button depressed.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
bfb87b24a3
commit
15e3db5932
@@ -124,6 +124,18 @@ void Internals::click(double x, double y, UIEvents::MouseButton button)
|
||||
page.handle_mouseup(position, position, button, 0, 0);
|
||||
}
|
||||
|
||||
void Internals::mouse_down(double x, double y)
|
||||
{
|
||||
mouse_down(x, y, UIEvents::MouseButton::Primary);
|
||||
}
|
||||
|
||||
void Internals::mouse_down(double x, double y, UIEvents::MouseButton button)
|
||||
{
|
||||
auto& page = internals_page();
|
||||
auto position = page.css_to_device_point({ x, y });
|
||||
page.handle_mousedown(position, position, button, 0, 0);
|
||||
}
|
||||
|
||||
void Internals::move_pointer_to(double x, double y)
|
||||
{
|
||||
auto& page = internals_page();
|
||||
|
||||
Reference in New Issue
Block a user