Repository navigation
chewing: add option to switch to English with Shift+letter - #1011
Open
DaveTseng2019 wants to merge 2 commits into
Open
DaveTseng2019 wants to merge 2 commits into
DaveTseng2019 wants to merge 2 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
easySymbolsWithShifton (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.upperCaseWithShift.Testing: tested by hand on Windows 11 (empty composition + Shift+H then
ellogives "Hello"; tapping Shift returns to Chinese; Chinese text + full-width punctuation in the buffer, then Shift+Hello, 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_imehas 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