Skip to content

Added: Send right mouse click on finger long press with mouse tracking - #5420

Open
trissim wants to merge 4 commits into
termux:masterfrom
OpenHCSDev:work/pi-shell-colleague--08d60541405342efa6d4f3330b320056--termux-app
Open

trissim wants to merge 4 commits into
termux:masterfrom
OpenHCSDev:work/pi-shell-colleague--08d60541405342efa6d4f3330b320056--termux-app

Conversation

@trissim

@trissim trissim commented Nov 2, 2026 •

Copy link
Copy Markdown

Summary

Tracked finger long press may send RIGHT press/release at the touched cell through the existing mouse encoder. Native text selection remains the default. Enable the explicit option in ~/.termux/termux.properties:

mouse-right-click-on-long-press = true

Reload with termux-reload-settings. Remove the option or set it to false for default selection. See the native long-press guide.

Requirement correction

The initial patch sent RIGHT unconditionally under tracking. Independent source review caught that this removed the requested choice between selection and right-click. The new correction gates RIGHT through the existing native client/property owner. The earlier318-execution combined run verified the old implementation, not this corrected policy.

Before / After

  • Before: tracking-on long press had no right-click option; the initial candidate then incorrectly made right-click mandatory.
  • After: a default-false client capability reads the existing cached Termux property. Only explicit opt-in, active tracking, finger source and no active selection select RIGHT. Otherwise the original client/selection path remains intact.
  • TerminalEmulator.MOUSE_RIGHT_BUTTON=2 still goes through sendMouseEvent; no second encoder, synthetic keybinding, copied gesture/tap-suppression state or Toad workaround.
  • The recognizer still suppresses the trailing LEFT tap after long press. Tracking-off and physical mouse paths remain unchanged even when the option is enabled.
  • Loaded boolean properties now derive from the existing default-behavior sets instead of restating13 keys in the application roster. Read-only source comparison preserves all32 existing loaded keys and adds only this option; no boolean default changed.

Verification

  • Eight Robolectric tests are authored: native default selection in1000+SGR and1002+SGR; opted-in RIGHT in1000+SGR,1002+SGR and legacy1002; unchanged tracking-off and physical-mouse paths; real property parser/default/admission.
  • Default-selection cases attach the real view to a real Android Activity and exercise selection instead of asserting only a consumed callback. Font metrics use native graphics with positive-width/line-spacing assertions.
  • git diff --check and read-only source key-set comparison pass. The correction's Android tests have not run yet. Hosted combined qualification is maintained in Integrate touch mouse gestures and verify candidate APK signatures OpenHCSDev/termux-app#1; exact source heads and execution epochs remain separate.
  • No APK installation or local/SSH/mosh phone acceptance is claimed. Current tester uses Google Play Termux; safe signer/variant/backup/migration checks remain required.

Scope

Only finger long press under existing mouse tracking. No1003 change, held-finger remote dragging or horizontal feature is bundled into this focused patch; those remain independent.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 07:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

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