Skip to content

Add Touchpad Mode for multi-directional cursor control (port from LeanType)#2438

Open
stanissay wants to merge 2 commits intoHeliBorg:mainfrom
stanissay:touchpad_mode
Open

Add Touchpad Mode for multi-directional cursor control (port from LeanType)#2438
stanissay wants to merge 2 commits intoHeliBorg:mainfrom
stanissay:touchpad_mode

Conversation

@stanissay
Copy link
Copy Markdown
Contributor

This PR introduces Touchpad Mode, allowing the cursor to move in any direction (up, down, left, right) for more precise text navigation.

How it works:

  • Activation: Swipe up from the Spacebar to trigger Touchpad Mode.

  • Navigation: While active, the cursor follows your finger's movement across the entire keyboard area, similar to a physical trackpad.

  • Deactivation: Lift your finger to exit the mode.

  • Compatibility: Existing gestures like horizontal spacebar swiping, gesture typing, and swipe-to-delete remain fully functional and unaffected.

Key Changes:

  • Gesture Handling: Integrated 2D movement logic into PointerTracker and KeyboardActionListener to handle both Java and Kotlin parts of the gesture system.

  • New Option: Added "Touchpad mode" to the available actions for the vertical swipe from spacebar gesture.

  • Sensitivity Control: Added a "Touchpad sensitivity" slider that becomes available in Settings when Touchpad Mode is selected.

  • Resources: Included necessary string resources for the new settings.

Credits:
This feature is a port from the LeanType fork by @LeanBitLab. I have adapted the logic to work with HeliBoard's current architecture.

video_2026-04-06_13-14-45.mp4

Closes #2367

@stanissay
Copy link
Copy Markdown
Contributor Author

This PR is a direct port from LeanType as it is currently implemented. However, I have a couple of ideas to further improve these functions if the community is interested:

Activation Threshold: Implement a vertical distance requirement so that Touchpad Mode activates only when the finger reaches approximately the middle of the keyboard's height. This would provide more "room" to move the finger downward once the mode is active.

Axis Priority (Directional Lock): Add checks to determine whether the horizontal or vertical delta is dominant. By focusing on the primary direction of the swipe, we can eliminate accidental vertical jumps during horizontal movement and vice versa, making cursor control much more precise.

Let me know what you think about these potential enhancements!

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.

Allow moving Cursor in both directions with a single spacebar gesture

1 participant