LibWeb: Add internals API to dispatch doubleclick mouse event
This commit is contained in:
parent
1be6c12501
commit
7dc11050f2
Notes:
github-actions[bot]
2024-11-01 17:12:14 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/7dc11050f2e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2108 Reviewed-by: https://github.com/trflynn89 ✅
3 changed files with 10 additions and 0 deletions
|
@ -100,6 +100,14 @@ void Internals::click(double x, double y)
|
|||
click(x, y, UIEvents::MouseButton::Primary);
|
||||
}
|
||||
|
||||
void Internals::doubleclick(double x, double y)
|
||||
{
|
||||
auto& page = internals_page();
|
||||
|
||||
auto position = page.css_to_device_point({ x, y });
|
||||
page.handle_doubleclick(position, position, UIEvents::MouseButton::Primary, 0, 0);
|
||||
}
|
||||
|
||||
void Internals::middle_click(double x, double y)
|
||||
{
|
||||
click(x, y, UIEvents::MouseButton::Middle);
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
void commit_text();
|
||||
|
||||
void click(double x, double y);
|
||||
void doubleclick(double x, double y);
|
||||
void middle_click(double x, double y);
|
||||
void move_pointer_to(double x, double y);
|
||||
void wheel(double x, double y, double delta_x, double delta_y);
|
||||
|
|
|
@ -21,6 +21,7 @@ interface Internals {
|
|||
undefined commitText();
|
||||
|
||||
undefined click(double x, double y);
|
||||
undefined doubleclick(double x, double y);
|
||||
undefined middleClick(double x, double y);
|
||||
undefined movePointerTo(double x, double y);
|
||||
undefined wheel(double x, double y, double deltaX, double deltaY);
|
||||
|
|
Loading…
Add table
Reference in a new issue