Fix Samsung keyboard trackpad cursor axes and add two-finger scroll support#1569
Open
BunnyTaylor wants to merge 2 commits into
Open
Conversation
Some keyboard trackpads (e.g. Samsung Galaxy Tab S11 Ultra Pro Keyboard) report AXIS_RELATIVE_X/Y rotated 90 degrees clockwise, causing up/down movement to move the cursor left/right and vice versa. This adds a user toggle in Input Settings to correct the axes.
Samsung Galaxy Tab keyboard trackpads send two-finger movement as ACTION_MOVE events with getPointerCount() == 2 rather than ACTION_SCROLL with AXIS_VSCROLL/HSCROLL. Detect this and route it to scroll instead of cursor movement. Also adds an "Invert scroll direction" toggle in Input Settings that reverses scroll direction for both trackpad two-finger scroll and standard ACTION_SCROLL events (e.g. mouse wheel).
|
+1 to this fix. Facing the same issue on S8 ultra keyboard as well. |
Author
@Qi, if you want the fix now, I just uploaded the built apk to my fork: github.com/BunnyTaylor/moonlight-android/releases/tag/V1.0.0. Let me know if it doesn't work for you so I can improve this issue! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
On the Samsung Galaxy Tab S11 Ultra with the Pro Keyboard, the trackpad moves the cursor in the wrong direction — physical up moves the cursor right, and physical left moves it up. Bluetooth mice and the touchscreen trackpad mode are unaffected.
Cause:
The keyboard's driver reports AXIS_RELATIVE_X/Y rotated 90° clockwise relative to what Android expects — physical Y data comes through as X and vice versa.
Fix:
Adds an opt-in toggle in Input Settings ("Rotate external trackpad axes") that corrects the axis mapping. It only applies to SOURCE_TOUCHPAD events and is off by default, so no existing behavior is affected.
Two-finger scroll on the trackpad was being treated as cursor movement because Samsung's keyboard driver sends it as ACTION_MOVE with getPointerCount() == 2 rather than ACTION_SCROLL with AXIS_VSCROLL/HSCROLL. The fix detects two-finger events and routes them to scroll commands instead.
An "Invert scroll direction" toggle has also been added to Input Settings, which reverses scroll direction for both trackpad two-finger scroll and standard mouse wheel (ACTION_SCROLL) events.