Skip to content

chewing: add option to switch to English with Shift+letter - #1011

Open
DaveTseng2019 wants to merge 2 commits into
EasyIME:masterfrom
DaveTseng2019:chewing-shift-letter-english
Open

DaveTseng2019 wants to merge 2 commits into
EasyIME:masterfrom
DaveTseng2019:chewing-shift-letter-english

Conversation

@DaveTseng2019

@DaveTseng2019 DaveTseng2019 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Adds a chewing option shiftLetterSwitchToEnglish (default off). When it is on and no bopomofo is half typed (and no candidate window is open), Shift+letter switches to English mode and stays there. Chinese text already in the composition buffer stays, and the English text follows it. Tap Shift to return to Chinese.

Design: bopomofo has no letter case, so an uppercase letter typed in Chinese mode is a reliable signal that the user is starting an English word (a name, a sentence, an acronym). Shift+letter is that signal, so it is used as the trigger to switch to English.

Why: with easySymbolsWithShift on (the default), Shift+letter on an empty composition outputs an easy symbol and leaves the IME in Chinese mode. Typing an English word such as "Hello" in Chinese mode then gives a symbol followed by bopomofo garbage. Turning off easy symbols only makes the first letter English; the rest are still bopomofo.

  • Chewing keeps Chinese text in the buffer until Enter, so requiring an empty composition would almost never switch mid-sentence. A half-typed bopomofo syllable or an open candidate window still blocks the switch.
  • Respects upperCaseWithShift.
  • Adds a checkbox under the Shift settings in the config tool.

Testing: tested by hand on Windows 11 (empty composition + Shift+H then ello gives "Hello"; tapping Shift returns to Chinese; Chinese text + full-width punctuation in the buffer, then Shift+H ello, switches to English and Enter commits the whole line; traced the key events in the backend to confirm the mode changes). 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 2 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>

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