Skip to content

Fix range button scrolling in touchmode#1446

Merged
utkarshdalal merged 1 commit into
utkarshdalal:masterfrom
Nightwalker743:fix/range-button-scrolling
May 17, 2026
Merged

Fix range button scrolling in touchmode#1446
utkarshdalal merged 1 commit into
utkarshdalal:masterfrom
Nightwalker743:fix/range-button-scrolling

Conversation

@Nightwalker743
Copy link
Copy Markdown
Contributor

@Nightwalker743 Nightwalker743 commented May 16, 2026

Description

This fixes the issue here:

https://discord.com/channels/1378308569287622737/1503770141635379381

Right now the range button is not scrollable when touchscreen mode is on. This PR fixes that issue.

Recording

Screen_Recording_20260515_221832_GameNative.mp4

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Fixes range/slider scrolling in touch mode so users can drag the control without triggering look/aim. Dragging now feels smooth and consistent in shooter mode.

  • Bug Fixes
    • Start look/aim tracking only when pressing BUTTON elements; sliders/range controls no longer capture the look pointer.
    • Pass pointer ID to handleTouchMove (instead of pointer index) for correct multi‑touch tracking during drags.

Written for commit bfb66ee. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Corrected multi-touch pointer identification in input controls to ensure accurate handling of simultaneous button interactions and improve reliability when multiple controls are used at once
  • Refactor

    • Reorganized button press event handling and look-around control logic in input controls for improved code structure and maintainability

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

📝 Walkthrough

Walkthrough

Two pointer-handling bugs in shooter-mode touch input are fixed: button-initiated look-around aim pointer tracking is reorganized for consistent state initialization, and multi-pointer move events now route using actual Android pointer ids instead of loop indices.

Changes

Multi-touch pointer handling and look-around aiming

Layer / File(s) Summary
Button pointer tracking for look-around aiming
app/src/main/java/com/winlator/widget/InputControlsView.java
In handleShooterTouchDown, when a BUTTON is tapped in shooter mode, pointer-tracking assignments for look-around aim are reorganized so the same pointer id consistently initializes either right-stick control state (rightJoystickPointerId and coordinates) or look-around state (lookPointerId, deltas, and lookFireElement).
Multi-pointer move event routing
app/src/main/java/com/winlator/widget/InputControlsView.java
In onTouchEvent during multi-pointer ACTION_MOVE handling, handleTouchMove now receives the actual Android pointer id from event.getPointerId(i) (pid) instead of the loop index i, ensuring correct per-pointer routing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • utkarshdalal

Poem

🐰 A pointer here, a pointer there,
Now tracking moves with proper care!
Buttons aim and fingers dance,
Multi-touch gets its rightful chance. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix range button scrolling in touchmode' directly and specifically summarizes the main bug fix addressed in this PR: enabling range/slider button scrolling functionality in touch mode.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description comprehensively addresses all required template sections: a clear description of the bug fix with Discord reference, a recording demonstrating the change, correct type of change selection (Bug fix), and all four checklist items marked as completed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@utkarshdalal utkarshdalal merged commit 64857f6 into utkarshdalal:master May 17, 2026
3 checks passed
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