mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Ladybird: Propagate "empty" key events to the WebContent process
We currently drop events which do not have text associated with them. This prevents e.g. arrow keys from being able to be handled by web elements. We now match Browser's behavior on Serenity, where these key events are already propagated.
This commit is contained in:
parent
27ca90646d
commit
b57199ccb9
Notes:
sideshowbarker
2024-07-17 06:39:26 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/b57199ccb9 Pull-request: https://github.com/SerenityOS/serenity/pull/19771
1 changed files with 2 additions and 8 deletions
|
@ -369,10 +369,7 @@ void WebContentView::keyPressEvent(QKeyEvent* event)
|
|||
}
|
||||
|
||||
auto text = event->text();
|
||||
if (text.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
auto point = event->text()[0].unicode();
|
||||
auto point = text.isEmpty() ? 0u : event->text()[0].unicode();
|
||||
auto keycode = get_keycode_from_qt_keyboard_event(*event);
|
||||
auto modifiers = get_modifiers_from_qt_keyboard_event(*event);
|
||||
client().async_key_down(keycode, modifiers, point);
|
||||
|
@ -381,10 +378,7 @@ void WebContentView::keyPressEvent(QKeyEvent* event)
|
|||
void WebContentView::keyReleaseEvent(QKeyEvent* event)
|
||||
{
|
||||
auto text = event->text();
|
||||
if (text.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
auto point = event->text()[0].unicode();
|
||||
auto point = text.isEmpty() ? 0u : event->text()[0].unicode();
|
||||
auto keycode = get_keycode_from_qt_keyboard_event(*event);
|
||||
auto modifiers = get_modifiers_from_qt_keyboard_event(*event);
|
||||
client().async_key_up(keycode, modifiers, point);
|
||||
|
|
Loading…
Reference in a new issue