1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

Ladybird: Handle forward and backward mouse buttons

We now emit a new signal for backward mouse button's mouseup and forward
mouse button's mouseup which is handled by going back and forward in the
history respectively:))
This commit is contained in:
Baitinq 2022-11-08 02:00:24 +01:00 committed by Andrew Kaster
parent ef553a4b76
commit 982174706b
3 changed files with 17 additions and 0 deletions

View file

@ -308,6 +308,13 @@ void WebContentView::mouseReleaseEvent(QMouseEvent* event)
{
Gfx::IntPoint position(event->position().x() / m_inverse_pixel_scaling_ratio, event->position().y() / m_inverse_pixel_scaling_ratio);
auto button = get_button_from_qt_event(*event);
if (event->button() & Qt::MouseButton::BackButton) {
emit back_mouse_button();
} else if (event->button() & Qt::MouseButton::ForwardButton) {
emit forward_mouse_button();
}
if (button == 0) {
// We could not convert Qt buttons to something that Lagom can
// recognize - don't even bother propagating this to the web engine