Skip to content

Fix Samsung keyboard trackpad cursor axes and add two-finger scroll support#1569

Open
BunnyTaylor wants to merge 2 commits into
moonlight-stream:masterfrom
BunnyTaylor:fix/samsung-s11-ultra-pro-keyboard-trackpad-fix
Open

Fix Samsung keyboard trackpad cursor axes and add two-finger scroll support#1569
BunnyTaylor wants to merge 2 commits into
moonlight-stream:masterfrom
BunnyTaylor:fix/samsung-s11-ultra-pro-keyboard-trackpad-fix

Conversation

@BunnyTaylor

Copy link
Copy Markdown

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.

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).
@Qi

Qi commented May 8, 2026

Copy link
Copy Markdown

+1 to this fix. Facing the same issue on S8 ultra keyboard as well.

@BunnyTaylor

Copy link
Copy Markdown
Author

+1 to this fix. Facing the same issue on S8 ultra keyboard as well.

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants