LibWeb: Pass non-accepted keydown events to PageView's base class

This will allow LibGUI's normal mechanisms to take over if the web
engine is not interested in the event right now.
This commit is contained in:
Andreas Kling 2020-08-14 19:39:34 +02:00
parent 7698feb8ce
commit 5939af14d4
Notes: sideshowbarker 2024-07-19 03:38:19 +09:00

View file

@ -296,7 +296,7 @@ void PageView::mouseup_event(GUI::MouseEvent& event)
void PageView::keydown_event(GUI::KeyEvent& event)
{
page().handle_keydown(event.key(), event.modifiers(), event.code_point());
bool page_accepted_event = page().handle_keydown(event.key(), event.modifiers(), event.code_point());
if (event.modifiers() == 0) {
switch (event.key()) {
@ -325,6 +325,10 @@ void PageView::keydown_event(GUI::KeyEvent& event)
vertical_scrollbar().set_value(vertical_scrollbar().value() - frame_inner_rect().height());
break;
default:
if (!page_accepted_event) {
ScrollableWidget::keydown_event(event);
return;
}
break;
}
}