Skip to content

feat: add commit-text input feature for swipe text input (optional)#266

Merged
ClassicOldSong merged 1 commit intoClassicOldSong:moonlight-noirfrom
tobitege:tobitege/fix-gesture-typing
Jul 11, 2025
Merged

feat: add commit-text input feature for swipe text input (optional)#266
ClassicOldSong merged 1 commit intoClassicOldSong:moonlight-noirfrom
tobitege:tobitege/fix-gesture-typing

Conversation

@tobitege
Copy link
Copy Markdown

@tobitege tobitege commented Jun 30, 2025

  • Add option to enable commit-text typing to enable swipe-typing;
  • Incl. translations for most languages (that's the most changed files with 2 lines added)
  • Tested on Android 16 with GBoard: swiped words get transmitted without extra trailing character
  • Added unit tests
  • Added a doc android_test_setup.md for creating unit tests in this repo (can be removed)

Fixes #121


Implementation summary by o3:

Implemented optional commit-text support with batching.

Key points:
1. New user-setting  
   • Preference key `checkbox_enable_commit_text` with default false added in `PreferenceConfiguration`.  
   • Field `enableCommitText` exposed and populated when preferences are read.

2. StreamView enhancements  
   • `setCommitTextEnabled(boolean)` toggles feature.  
   • When enabled, the view now reports itself as a text-editor and provides a `BaseInputConnection`.  
   • Added callbacks `handleCommitText` / `handleDeleteSurroundingText` to `InputCallbacks` and invoke them from the custom `InputConnection`.

3. Game activity  
   • Registers the new preference (`prefConfig.enableCommitText`) via `streamView.setCommitTextEnabled(...)`.  
   • Implements the two new callback methods.  
   • Adds a queue + handler that splits committed text into 512-byte UTF-8 chunks and sends them with 15 ms spacing.  
   • Implements deletion handling by emitting Backspace key events.  

4. Support code  
   • Added constants, imports, and helper fields (Handler, Queue, StandardCharsets, etc.).

All changes are strictly additive and guarded by the new preference, so existing behaviour remains unchanged until the option is enabled.

@ClassicOldSong
Copy link
Copy Markdown
Owner

I'm really busy recently, I'll review later. Thanks for the contribution!

@ClassicOldSong ClassicOldSong merged commit 9b63030 into ClassicOldSong:moonlight-noir Jul 11, 2025
@tobitege tobitege deleted the tobitege/fix-gesture-typing branch July 11, 2025 13:30
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.

[Issue]: Gesture typing on android doesn't send the word until I send another key

2 participants