Skip to content

chewing: switch back to Chinese on Enter after Shift+letter - #1012

Open
DaveTseng2019 wants to merge 3 commits into
EasyIME:masterfrom
DaveTseng2019:chewing-enter-switch-back
Open

DaveTseng2019 wants to merge 3 commits into
EasyIME:masterfrom
DaveTseng2019:chewing-enter-switch-back

Conversation

@DaveTseng2019

Copy link
Copy Markdown
Contributor

Depends on #1011. This branch is stacked on it, so the first two commits here belong to #1011; only the last commit (chewing: switch back to Chinese on Enter after Shift+letter) is new. I will rebase onto master once #1011 is merged.

Adds a chewing option enterSwitchBackToChinese (default off). After shiftLetterSwitchToEnglish has switched to English, plain Enter returns to Chinese mode.

Why: the typical flow is Chinese text, an English word or phrase, then Enter. Without this, the next line starts in English and the user has to tap Shift every time.

  • Works both when Enter commits the composition buffer and when the buffer is empty and Enter passes through to the app as a newline. Enter still reaches the app in both cases.
  • Shift/Ctrl/Alt+Enter do not switch, so a newline inside a chat message keeps English.
  • Only applies to an automatic switch. A manual Shift toggle to English is not affected.

Testing: tested by hand on Windows 11, and traced the key events in the backend: Chinese + full-width punctuation in the buffer, Shift+H ello, Enter commits the line and the following keys are handled in Chinese mode. No unit test added: chewing_ime has no unit test harness and needs libchewing and the TSF client.

Architecture and design by Dave Tseng. Implementation generated with AI assistance from Claude Code (Claude Opus 5.5).

🤖 Generated with Claude Code

DaveTseng2019 and others added 3 commits October 27, 2026 11:21
With easySymbolsWithShift on, Shift+letter on an empty composition
outputs an easy symbol and leaves the IME in Chinese mode, so typing
an English word such as "Hello" yields a symbol plus bopomofo garbage.

- New option shiftLetterSwitchToEnglish (default off).
- When on and nothing is being composed, Shift+letter switches to
  English mode and keeps it; tap Shift to return to Chinese.
- Takes priority over easy symbols for Shift+letter only.

Architecture and design by Dave Tseng. Implementation generated with AI assistance from Claude Code (Claude Opus 5.5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chewing keeps Chinese text and punctuation in the composition buffer
until Enter, so requiring an empty composition meant Shift+letter
almost never switched in the middle of a sentence. Switch whenever no
bopomofo is half typed and no candidate window is open; the English
text follows the buffered Chinese.

Architecture and design by Dave Tseng. Implementation generated with AI assistance from Claude Code (Claude Opus 5.5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Builds on shiftLetterSwitchToEnglish (EasyIME#1011). After Shift+letter has
switched to English, typing usually ends with Enter, and the user then
wants Chinese again.

- New option enterSwitchBackToChinese (default off).
- Plain Enter, whether it commits the composition or passes through
  as a newline, returns to Chinese mode. Enter still reaches the app.
- Shift/Ctrl/Alt+Enter (e.g. a newline in chat apps) do not switch.
- A manual Shift toggle to English is not affected.

Architecture and design by Dave Tseng. Implementation generated with AI assistance from Claude Code (Claude Opus 5.5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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