Skip to content

Commit 48780bd

Browse files
committed
Add support to mouse controlled scrolling
Bug: 383555305 Test: N/A Flag: com.android.hardware.input.mouse_scrolling_acceleration Change-Id: I26c39339f0ec8b557d42a350731e3e6a2ba0a8db
1 parent 8a2ac03 commit 48780bd

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

libs/input/android/os/IInputConstants.aidl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ interface IInputConstants
7676
/* The default pointer acceleration value. */
7777
const int DEFAULT_POINTER_ACCELERATION = 3;
7878

79+
/* The default mouse wheel acceleration value. */
80+
const int DEFAULT_MOUSE_WHEEL_ACCELERATION = 4;
81+
7982
/**
8083
* Use the default Velocity Tracker Strategy. Different axes may use different default
8184
* strategies.

services/inputflinger/include/InputReaderBase.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ struct InputReaderConfiguration {
279279
static_cast<float>(
280280
android::os::IInputConstants::
281281
DEFAULT_POINTER_ACCELERATION)),
282-
wheelVelocityControlParameters(1.0f, 15.0f, 50.0f, 4.0f),
282+
wheelVelocityControlParameters(1.0f, 15.0f, 50.0f,
283+
static_cast<float>(
284+
android::os::IInputConstants::
285+
DEFAULT_MOUSE_WHEEL_ACCELERATION)),
283286
pointerGesturesEnabled(true),
284287
pointerGestureQuietInterval(100 * 1000000LL), // 100 ms
285288
pointerGestureDragMinSwitchSpeed(50), // 50 pixels per second

0 commit comments

Comments
 (0)