mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 01:58:12 +00:00
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:
parent
7698feb8ce
commit
5939af14d4
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue