diff options
| author | 2024-09-13 19:17:25 +0000 | |
|---|---|---|
| committer | 2024-10-08 20:13:21 +0000 | |
| commit | 2ac7e8169faa060ac33deb48847d07fb9fc4e680 (patch) | |
| tree | 9a0e43ca636317c203337d973f7f5e4776a48c42 /services/inputflinger/include | |
| parent | e227cadd47fe644efaf1e43a3c224b0571025d9d (diff) | |
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
Diffstat (limited to 'services/inputflinger/include')
| -rw-r--r-- | services/inputflinger/include/InputReaderBase.h | 10 |
1 files changed, 9 insertions, 1 deletions
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<int32_t /* fromKeyCode */, int32_t /* toKeyCode */> 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<DisplayViewport> getDisplayViewportByType(ViewportType type) const; std::optional<DisplayViewport> getDisplayViewportByUniqueId(const std::string& uniqueDisplayId) |