Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07ac7642 authored by Yuhan Yang's avatar Yuhan Yang
Browse files

Fix mouse key not moving at minimum max speed

Fix the issue that when the mouse keys max speed setting is at
its minimum value, the mouse keys does not moving in diagonal
directions becasue the mMaxMovementStep is smaller than 1.

Bug: 430967163
Test: atest MouseKeysInterceptorTest
Flag: com.android.server.accessibility.enable_mouse_key_enhancement
Change-Id: I5ae95e911c36f566119305e36fe7c9095a476d1e
parent 5a077e1a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -114,11 +114,11 @@ public class MouseKeysInterceptor extends BaseEventStreamTransformation

    /**
     * The parameter that converts the mouse keys max speed factor that ranges from 1 - 10
     * to the actual float mouse pointer movement step. Assigning its value to 0.36f so
     * the DEFAULT_MOUSE_KEYS_MAX_SPEED matches the constant MOUSE_POINTER_MOVEMENT_STEP
     * when enableMouseKeyEnhancement flag is off.
     * to the actual float mouse pointer movement step. Assigning its value to sqrt(2)
     * so the mMaxMovementStep is guaranteed to be greater than 1.0, and has different values
     * for each different max speed factor,
     */
    private static final float CURSOR_MOVEMENT_PARAMETER = 0.36f;
    private static final float CURSOR_MOVEMENT_PARAMETER = sqrt(2);

    private final AccessibilityManagerService mAms;
    private final Handler mHandler;