mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
WindowServer: Add "Natural scrolling" support
Also commonly referred to as "reverse scrolling" or "inverted scrolling".
This commit is contained in:
parent
bef9ad4e44
commit
5a083c03a6
Notes:
sideshowbarker
2024-07-17 03:44:24 +09:00
Author: https://github.com/filiphsps
Commit: 5a083c03a6
Pull-request: https://github.com/SerenityOS/serenity/pull/16265
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/linusg
7 changed files with 39 additions and 1 deletions
|
@ -70,10 +70,15 @@ void EventLoop::drain_mouse()
|
|||
state.x = packet.x;
|
||||
state.y = packet.y;
|
||||
}
|
||||
state.z += packet.z;
|
||||
state.w += packet.w;
|
||||
state_is_sent = false;
|
||||
|
||||
// Invert scroll direction if checked in the settings.
|
||||
if (WindowManager::the().is_natural_scroll())
|
||||
state.z -= packet.z;
|
||||
else
|
||||
state.z += packet.z;
|
||||
|
||||
if (packet.buttons != state.buttons) {
|
||||
state.buttons = packet.buttons;
|
||||
dbgln_if(WSMESSAGELOOP_DEBUG, "EventLoop: Mouse Button Event");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue