summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibWeb/OutOfProcessWebView.cpp5
-rw-r--r--Userland/Libraries/LibWeb/OutOfProcessWebView.h1
-rw-r--r--Userland/Libraries/LibWeb/Page/EventHandler.cpp7
-rw-r--r--Userland/Libraries/LibWeb/Page/EventHandler.h1
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.cpp5
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.h1
-rw-r--r--Userland/Libraries/LibWeb/UIEvents/EventNames.h1
-rw-r--r--Userland/Services/WebContent/ClientConnection.cpp5
-rw-r--r--Userland/Services/WebContent/ClientConnection.h1
-rw-r--r--Userland/Services/WebContent/WebContentServer.ipc1
10 files changed, 28 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
index 28bd7dffce..49f24646b8 100644
--- a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
+++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
@@ -161,6 +161,11 @@ void OutOfProcessWebView::keydown_event(GUI::KeyEvent& event)
client().async_key_down(event.key(), event.modifiers(), event.code_point());
}
+void OutOfProcessWebView::keyup_event(GUI::KeyEvent& event)
+{
+ client().async_key_up(event.key(), event.modifiers(), event.code_point());
+}
+
void OutOfProcessWebView::mousedown_event(GUI::MouseEvent& event)
{
client().async_mouse_down(to_content_position(event.position()), event.button(), event.buttons(), event.modifiers());
diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.h b/Userland/Libraries/LibWeb/OutOfProcessWebView.h
index b5e1bfeecd..7d812a2ecf 100644
--- a/Userland/Libraries/LibWeb/OutOfProcessWebView.h
+++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.h
@@ -96,6 +96,7 @@ private:
virtual void mousemove_event(GUI::MouseEvent&) override;
virtual void mousewheel_event(GUI::MouseEvent&) override;
virtual void keydown_event(GUI::KeyEvent&) override;
+ virtual void keyup_event(GUI::KeyEvent&) override;
virtual void theme_change_event(GUI::ThemeChangeEvent&) override;
virtual void screen_rects_change_event(GUI::ScreenRectsChangeEvent&) override;
diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp
index 0df361d9b0..cfc576e981 100644
--- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp
+++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp
@@ -460,6 +460,13 @@ bool EventHandler::handle_keydown(KeyCode key, unsigned modifiers, u32 code_poin
return m_frame.active_document()->window().dispatch_event(move(event));
}
+bool EventHandler::handle_keyup(KeyCode key, unsigned modifiers, u32 code_point)
+{
+ auto event = UIEvents::KeyboardEvent::create_from_platform_event(UIEvents::EventNames::keyup, key, modifiers, code_point);
+ // FIXME: Figure out the right event target.
+ return m_frame.active_document()->window().dispatch_event(move(event));
+}
+
void EventHandler::set_mouse_event_tracking_layout_node(Layout::Node* layout_node)
{
if (layout_node)
diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.h b/Userland/Libraries/LibWeb/Page/EventHandler.h
index 095dcb77f1..86ef6ac2f8 100644
--- a/Userland/Libraries/LibWeb/Page/EventHandler.h
+++ b/Userland/Libraries/LibWeb/Page/EventHandler.h
@@ -30,6 +30,7 @@ public:
bool handle_mousewheel(const Gfx::IntPoint&, unsigned buttons, unsigned modifiers, int wheel_delta);
bool handle_keydown(KeyCode, unsigned modifiers, u32 code_point);
+ bool handle_keyup(KeyCode, unsigned modifiers, u32 code_point);
void set_mouse_event_tracking_layout_node(Layout::Node*);
diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp
index 5c860bf81a..0a44879978 100644
--- a/Userland/Libraries/LibWeb/Page/Page.cpp
+++ b/Userland/Libraries/LibWeb/Page/Page.cpp
@@ -81,4 +81,9 @@ bool Page::handle_keydown(KeyCode key, unsigned modifiers, u32 code_point)
return focused_context().event_handler().handle_keydown(key, modifiers, code_point);
}
+bool Page::handle_keyup(KeyCode key, unsigned modifiers, u32 code_point)
+{
+ return focused_context().event_handler().handle_keyup(key, modifiers, code_point);
+}
+
}
diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h
index 077a605262..4622603674 100644
--- a/Userland/Libraries/LibWeb/Page/Page.h
+++ b/Userland/Libraries/LibWeb/Page/Page.h
@@ -52,6 +52,7 @@ public:
bool handle_mousewheel(const Gfx::IntPoint&, unsigned button, unsigned modifiers, int wheel_delta);
bool handle_keydown(KeyCode, unsigned modifiers, u32 code_point);
+ bool handle_keyup(KeyCode, unsigned modifiers, u32 code_point);
Gfx::Palette palette() const;
Gfx::IntRect screen_rect() const;
diff --git a/Userland/Libraries/LibWeb/UIEvents/EventNames.h b/Userland/Libraries/LibWeb/UIEvents/EventNames.h
index 66a3bba882..9c71ef4ab2 100644
--- a/Userland/Libraries/LibWeb/UIEvents/EventNames.h
+++ b/Userland/Libraries/LibWeb/UIEvents/EventNames.h
@@ -16,6 +16,7 @@ namespace Web::UIEvents::EventNames {
#define ENUMERATE_UI_EVENTS \
__ENUMERATE_UI_EVENT(click) \
__ENUMERATE_UI_EVENT(keydown) \
+ __ENUMERATE_UI_EVENT(keyup) \
__ENUMERATE_UI_EVENT(mousedown) \
__ENUMERATE_UI_EVENT(mouseenter) \
__ENUMERATE_UI_EVENT(mouseleave) \
diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp
index 0032be4353..b9a4d25e44 100644
--- a/Userland/Services/WebContent/ClientConnection.cpp
+++ b/Userland/Services/WebContent/ClientConnection.cpp
@@ -169,6 +169,11 @@ void ClientConnection::key_down(i32 key, unsigned int modifiers, u32 code_point)
page().handle_keydown((KeyCode)key, modifiers, code_point);
}
+void ClientConnection::key_up(i32 key, unsigned int modifiers, u32 code_point)
+{
+ page().handle_keyup((KeyCode)key, modifiers, code_point);
+}
+
void ClientConnection::debug_request(const String& request, const String& argument)
{
if (request == "dump-dom-tree") {
diff --git a/Userland/Services/WebContent/ClientConnection.h b/Userland/Services/WebContent/ClientConnection.h
index 79fe50f866..200ff744da 100644
--- a/Userland/Services/WebContent/ClientConnection.h
+++ b/Userland/Services/WebContent/ClientConnection.h
@@ -47,6 +47,7 @@ private:
virtual void mouse_up(Gfx::IntPoint const&, unsigned, unsigned, unsigned) override;
virtual void mouse_wheel(Gfx::IntPoint const&, unsigned, unsigned, unsigned, i32) override;
virtual void key_down(i32, unsigned, u32) override;
+ virtual void key_up(i32, unsigned, u32) override;
virtual void add_backing_store(i32, Gfx::ShareableBitmap const&) override;
virtual void remove_backing_store(i32) override;
virtual void debug_request(String const&, String const&) override;
diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc
index a79859d381..06583ae13f 100644
--- a/Userland/Services/WebContent/WebContentServer.ipc
+++ b/Userland/Services/WebContent/WebContentServer.ipc
@@ -23,6 +23,7 @@ endpoint WebContentServer
mouse_wheel(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers, i32 wheel_delta) =|
key_down(i32 key, unsigned modifiers, u32 code_point) =|
+ key_up(i32 key, unsigned modifiers, u32 code_point) =|
debug_request(String request, String argument) =|
get_source() =|