Skip to content

feat(input): add Hold for Cursor Mode with mouse & touchscreen simulation - #5

Open
aalexx-S wants to merge 2 commits into
SonicDX12:mainfrom
aalexx-S:main
Open

aalexx-S wants to merge 2 commits into
SonicDX12:mainfrom
aalexx-S:main

Conversation

@aalexx-S

@aalexx-S aalexx-S commented Nov 3, 2026 •

Copy link
Copy Markdown

Summary

Adds Hold for Cursor Mode (XboxTarget.CURSOR_HOLD, mapped to L4 by default) so users can hold a modifier button during gameplay to seamlessly control an on-screen pointer or simulate finger touch without leaving their gamepad profile.

Features

  • Joystick Cursor & Scroll Control:
    • While the mapped modifier button is held, Left Stick moves the cursor (with a quadratic response curve and sub-pixel accumulation) and Right Stick scrolls—while suppressing stick deflection from reaching the virtual gamepad.
  • Configuration Sub-Menu (... Button):
    • Simulate Finger Touch Toggle:
      • Off (System Mouse Cursor): Uses the hardware uinput mouse device (SOURCE_MOUSE) and destroys g_fd_mouse as soon as the hold button is released so Android immediately hides the pointer.
      • On (Touchscreen Simulation): Displays a custom floating reticle (TouchCursorOverlay) while held, injects real SOURCE_TOUCHSCREEN (TOOL_TYPE_FINGER) ACTION_DOWN / ACTION_MOVE / ACTION_UP events via Shizuku IInputManager, and performs continuous touch-swipe scrolling with the Right Stick (snapping the cursor back to the scroll origin upon release).
    • Independent Sliders: Separate Cursor sensitivity (0.1x - 5.0x) and Scroll speed (0.1x - 5.0x) settings (also raised trackpad mouse sensitivity max to 5.0x).
    • Multi-Button Click / Confirm Mapping: Select any combination of controller buttons (default A + RT) to act as Left Click / Touch Tap-and-Drag while the cursor modifier is held.
  • Profile & Backup Integration:
    • All Hold for Cursor Mode settings are saved per NamedProfile and included in JSON backups (BackupManager).

License

I hereby submit and license this contribution under the MIT License.

aalexx-S and others added 2 commits November 3, 2026 00:01
…tion

- Add XboxTarget.CURSOR_HOLD ('Hold for Cursor Mode', default L4), MOUSE_LEFT, and MOUSE_RIGHT targets
- Add CursorHoldConfigDialog accessible via the '...' button next to Hold for Cursor Mode:
  - Toggle between System Mouse Cursor (uinput SOURCE_MOUSE) and Simulate Finger Touch (Shizuku IInputManager SOURCE_TOUCHSCREEN + floating TouchCursorOverlay reticle)
  - Separate Cursor sensitivity (0.1x..5.0x) and Scroll speed (0.1x..5.0x) sliders
  - Multi-select Click/Confirm button bindings (default A + RT)
- Hide system mouse cursor immediately on modifier release by destroying/recreating the sidecar uinput mouse device
- Support Right Stick touch-swipe scrolling in Touch Simulation mode, returning the cursor to the scroll start position on release
- Persist settings across NamedProfile and BackupManager
feat(input): add Hold for Cursor Mode with mouse & touchscreen simulation
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.

1 participant