Skip to content

Enable Voice Input#87

Open
nindanaoto wants to merge 1 commit intoconnectbot:mainfrom
nindanaoto:voiceinput
Open

Enable Voice Input#87
nindanaoto wants to merge 1 commit intoconnectbot:mainfrom
nindanaoto:voiceinput

Conversation

@nindanaoto
Copy link
Contributor

Fix connectbot/connectbot#1578.

This PR modifies ImeInputView.kt to fix how IME composing text is handled, specifically to support voice input (e.g., board voice typing). Key changes:

  1. Editor info reconfigured — Removes password-type flags and TYPE_TEXT_FLAG_NO_SUGGESTIONS so Gboard's suggestion strip (which hosts the voice input button) remains visible. Sets valid initial selection and uses fullEditor=true so getExtractedText() returns non-null.
  2. Composing text tracking — Adds setComposingText() and finishComposingText() overrides that track the current composition and incrementally send only the delta characters to the terminal, handling appends, deletions, and full replacements.
  3. Composition-clear handling — When the IME clears composition before commit (as Gboard voice does), backspaces the projected composing text to avoid duplicates or stale input.
  4. Commit text rewrite — commitText() now removes any projected composing text before sending the final committed string, and clears the internal Editable to prevent unbounded growth.

This PR is written with Codex because Claude Code does not seem to be working well, though this might be my fault in writing the prompt.

When IME clears composition before commit (e.g. Gboard voice), backspace the projected composing text to avoid duplicates or stale input.
@kruton
Copy link
Member

kruton commented Jan 31, 2026

I was imagining adding a compose mode that didn't send text to the terminal. You don't really know what backspace is going to do on the remote end. It may exit a program or something unexpected.

I was imagining a meta typing mode where a string of text being typed would just be overlaid over the current cursor position and slide to the left if it became too long to display on the current line instead of causing a line wrap. Then a commit would send the text to the remote server.

Typing would look like any other text input:
Screenshot_20260131-075835.png

@nindanaoto
Copy link
Contributor Author

Currently, I guess that we can use an existing text input functionality (the pen mark of the special key) for this purpose, if someone cares about the backspace behavior.

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.

Keyboard voice input

2 participants