feat: support chorded input #246
Draft
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.
须知
支持并击,才称得上完整实现 Rime 的功能。
并击,同时按下键盘上的多个按键,手指松开时将击下的一组键当作输入发送。
做法并不优美。
Emacs 输入法不会收到抬键的 key release 消息,无法准确判断一次并击何时结束。
Rime 并击方案使用
librime
的chord_composer
组件,他会设置_chord_typing
为 true,该状态与输入方案生命周期一致。rime.el
读取该状态,即可决定启用并击处理。并击开始时,PR 修改的代码设置了一个计时器,等待 0.2 秒,这是熟练用家足以完成一次并击的时间。
这期间击下的字符键已经由
chord_composer
缓存住,可作为该次并击结果。计时器响时,模拟出与之匹配的抬键的消息发给 librime,让他结束并击检测并开始译码。
librime 给出的结果可能是更新候选字或文字上屏(如单击空格仍为空格,空格也可并击输入拼音)。