From 2ac7e8169faa060ac33deb48847d07fb9fc4e680 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Fri, 13 Sep 2024 19:17:25 +0000 Subject: Mouse: Add support to reverse vertical mouse scroll Bug: 359349392 Bug: 352598211 Test: atest CursorInputMapperUnitTest Flag: com.android.hardware.input.mouse_reverse_vertical_scrolling Change-Id: Ib6b20f571b76cb0643bd2b31bcc8daa926306927 --- services/inputflinger/include/InputReaderBase.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'services/inputflinger/include') diff --git a/services/inputflinger/include/InputReaderBase.h b/services/inputflinger/include/InputReaderBase.h index 2f6c6d74e7..69ae587942 100644 --- a/services/inputflinger/include/InputReaderBase.h +++ b/services/inputflinger/include/InputReaderBase.h @@ -96,6 +96,9 @@ struct InputReaderConfiguration { // The key remapping has changed. KEY_REMAPPING = 1u << 14, + // The mouse settings changed, this includes mouse reverse vertical scrolling. + MOUSE_SETTINGS = 1u << 15, + // All devices must be reopened. MUST_REOPEN = 1u << 31, }; @@ -252,6 +255,10 @@ struct InputReaderConfiguration { // Keycodes to be remapped. std::map keyRemapping; + // True if the external mouse should have its vertical scrolling reversed, so that rotating the + // wheel downwards scrolls the content upwards. + bool mouseReverseVerticalScrollingEnabled; + InputReaderConfiguration() : virtualKeyQuietTime(0), defaultPointerDisplayId(ui::LogicalDisplayId::DEFAULT), @@ -282,7 +289,8 @@ struct InputReaderConfiguration { shouldNotifyTouchpadHardwareState(false), touchpadRightClickZoneEnabled(false), stylusButtonMotionEventsEnabled(true), - stylusPointerIconEnabled(false) {} + stylusPointerIconEnabled(false), + mouseReverseVerticalScrollingEnabled(false) {} std::optional getDisplayViewportByType(ViewportType type) const; std::optional getDisplayViewportByUniqueId(const std::string& uniqueDisplayId) -- cgit v1.2.3-59-g8ed1b