mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibWeb: Add Internals.middleClick
This simulates click of the middle mouse button, which is necessary for testing whether the `auxevent` fires correctly.
This commit is contained in:
committed by
Andreas Kling
parent
9220a89d2f
commit
728fca1b1f
@@ -77,10 +77,20 @@ void Internals::commit_text()
|
||||
}
|
||||
|
||||
void Internals::click(double x, double y)
|
||||
{
|
||||
click(x, y, UIEvents::MouseButton::Primary);
|
||||
}
|
||||
|
||||
void Internals::middle_click(double x, double y)
|
||||
{
|
||||
click(x, y, UIEvents::MouseButton::Middle);
|
||||
}
|
||||
|
||||
void Internals::click(double x, double y, UIEvents::MouseButton button)
|
||||
{
|
||||
auto& page = global_object().browsing_context()->page();
|
||||
page.handle_mousedown({ x, y }, { x, y }, 1, 0, 0);
|
||||
page.handle_mouseup({ x, y }, { x, y }, 1, 0, 0);
|
||||
page.handle_mousedown({ x, y }, { x, y }, button, 0, 0);
|
||||
page.handle_mouseup({ x, y }, { x, y }, button, 0, 0);
|
||||
}
|
||||
|
||||
void Internals::move_pointer_to(double x, double y)
|
||||
|
||||
Reference in New Issue
Block a user