Repository navigation
Conversation
- DISPATCH_ACTIONS 新增 set_mode:english / set_mode:chinese 两个动词, 限修饰键(keyup 轻敲通路),与 toggle_mode 同族但不在中文态限定内 - handle_toggle_mode_cased 泛化为 handle_switch_mode_cased(target: Option<bool>), None 维持翻转语义,Some(x) 定向置态(已在目标态幂等无操作) - coordinator 新增 set_mode_with_commit:编码中途按下先上屏再切, 与切中英既有收口路径共用 take_input_on_mode_switch_cased - 出厂默认不变(lshift/rshift 仍为 toggle);keys.key_actions 绑定经由 既有「绑定优先于出厂 toggle」通路生效,无需新开关 - 新增 tests/set_mode_binding.rs:定向切换、幂等、未绑侧保持 toggle、 编码中上屏四条契约
此前 caps 取消分支恒走 CapsCancelSwitch::Toggle,出厂 mode_after_cancel=chinese 会把 set_mode:english 按回中文,用户看来是「按了没反应」。新增 Directed 变体: 带明确目标的切换取消锁定的同时直达目标,归位配置只管没有方向的翻转。
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
recheck |
`bare_function_key_needs_chinese` 的豁免清单只认 toggle_mode / switch_engine / toggle_schema:* / switch_schema:*,没有 set_mode:*。于是把 set_mode:chinese 绑到 F1–F12 时,编译期就给它打上 CHINESE_ONLY,英文态下按键在 TSF 侧被直接放行、到不了 协调器——该绑定在英文态等于没有,在中文态则等于没按。 改为按动词显式判定的 match,并把 set_mode:* 一并豁免;补 f6/f7 两条断言与组合键 策略表两行。
- `mode_after_caps_cancel_matrix` 之前删掉了 `chinese/Toggle` 那条断言,出厂默认档 只剩 bogus/空串兜底,补回。 - 新增 `set_mode_keeps_caps_when_cancel_disabled`:cancel_on_mode_switch 关闭时, 大写态下调用 set_mode:chinese 只置位中英态、不动 CapsLock(由配置决定是否解锁)。 - 纠正 `set_mode_with_commit` 的文档:目标中文时余码是丢弃而非上屏,状态泡文案相同 时也不会刷新;删掉 message_handler 里重复的一行注释。
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.
What
keys.key_actionsaccepts two new verbs:set_mode:english/set_mode:chinese— a modifier key can now switch to a specific mode instead of toggling.CapsCancelSwitch::Directed(bool)variant: when CapsLock is on, a directed switch cancels the lock and lands on the requested target; the plaintoggle_modepath keeps the existingmode_after_cancelsemantics unchanged (factory behavior untouched).Why
With CapsLock on, the factory
mode_after_cancel = chineserewroteset_mode:englishback to Chinese — users saw "press has no effect". Directed switches now bypass the rewrite; toggle keys keep their old behavior. Noteinput.capslock.cancel_on_mode_switchstays off by default; nothing changed about factory defaults.Tests
cargo test -p wind-config: 758 passed (verb parse tests added: case-insensitivity, bad payloads rejected, modifier-only classification)cargo test -p wind-coordinator --lib: 1439 passed (matrix test extended with Directed assertions; 2 pre-existing failures inhandle_candidate::expand_stop_testsare unrelated data-fixture issues present on main)cargo test -p wind-coordinator --test set_mode_binding: 4 passed (new integration test: lshift→english, rshift→chinese, idempotence, factory toggle untouched, mid-composition commit)Live-verified on a real TSF host: CapsLock on + LShift tap → lock cancelled, lands on English; repeated taps stay idempotent.