diff options
author | Andreas Kling <kling@serenityos.org> | 2020-05-02 22:07:43 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-02 22:07:43 +0200 |
commit | 67b92a7d5f5472b0fb2b8cc730d95bd5cc6b6ff5 (patch) | |
tree | f1fe638c7ecfd6d1ec33988dfd607207f7ae4cbe /Libraries | |
parent | c5882d3a189904017192d4eeaa2631cb0f5a1d1f (diff) | |
download | serenity-67b92a7d5f5472b0fb2b8cc730d95bd5cc6b6ff5.zip |
WindowServer+LibGUI: Support the 4th and 5th mouse buttons
We'll call the "Back" and "Forward" since that's what they are normally
mapped to in some other systems.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/Event.h | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/WindowServerConnection.cpp | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGUI/Event.h b/Libraries/LibGUI/Event.h index 6c2374ccfb..2b2adf7bac 100644 --- a/Libraries/LibGUI/Event.h +++ b/Libraries/LibGUI/Event.h @@ -257,6 +257,8 @@ enum MouseButton : u8 { Left = 1, Right = 2, Middle = 4, + Back = 8, + Forward = 16, }; class KeyEvent final : public Event { diff --git a/Libraries/LibGUI/WindowServerConnection.cpp b/Libraries/LibGUI/WindowServerConnection.cpp index 036cf64869..441294598d 100644 --- a/Libraries/LibGUI/WindowServerConnection.cpp +++ b/Libraries/LibGUI/WindowServerConnection.cpp @@ -178,6 +178,10 @@ MouseButton to_gmousebutton(u32 button) return MouseButton::Right; case 4: return MouseButton::Middle; + case 8: + return MouseButton::Back; + case 16: + return MouseButton::Forward; default: ASSERT_NOT_REACHED(); break; |