rime / librime

Rime Input Method Engine, the core library
https://rime.im
BSD 3-Clause "New" or "Revised" License
3.37k stars 551 forks source link

空碼清屏 #60

Closed osfans closed 8 years ago

osfans commented 8 years ago

http://tieba.baidu.com/p/2316742388

空碼時,自動清屏。 或者空碼按空格時,手動清屏。目前似乎是字母上屏。

不知跟語句流等功能是否有衝突。

linzianxyz commented 8 years ago

语句流即fluency editor的确实是以空格上屏。如果实现了空格清屏,肯定这个语句模式不能用的。

osfans commented 8 years ago

那語句流的空碼怎麼辦呢?或者語句流不會有空碼?

linzianxyz commented 8 years ago

任何输入方案都有空码或错码的存在。 刚试了语句模式。与一般的连打相比,多了一个“预上屏”的功能,即空格后先将字或词放进一个类似“剪贴板”的東西裏,然后再一次空格才会上屏。不論空碼與否,其流程都是一樣的。語句流程一樣過有空碼,即空格未按下时,修改與其他的並無二致。但一旦空格之後,此時有兩種方法:一是直接按esc鍵,不論是有空格上屏還是什麼,清屏。而退格鍵則不會起到清屏的作用,它只會起將處於剪貼板中的東西重新“拿出來”,之後修改的就和連打一樣了。 這裏,在rime裏esc鍵是在任何方案下都是真正起到清屏作用。目前設想能不能將這一功能,也以空格來复制这一功能。

linzianxyz commented 8 years ago

现在的rime空格在错码空码的情况下,是直接输出编码,这很不合理。

osfans commented 8 years ago

default.yaml中加這兩句可以空格清屏,回車清屏可參考修改。

- { when: composing, accept: space, send: Escape }
- { when: has_menu, accept: space, send: space }

773a40fdc07df76b51ea4a73f41f445f1dec3707 實現了如下功能:

speller:
  auto_clear: true #清屏總開關,默認需要其他按鍵頂
  auto_clear_at_max: true #是否僅在碼長爲max_code_length時空碼清屏
  auto_clear_commit: true #是否自動清屏,不需要其他按鍵頂
lotem commented 8 years ago
speller:
  auto_clear: true
  auto_clear_at_max: true
  auto_clear_commit: false

這樣配置,打滿最大碼長無選,需要按空格清屏,對嘛?

lotem commented 8 years ago

我認爲空碼按確認鍵(空格)清屏,不需要限制當前編碼長度。已經輸錯,無論多長都該清除了。 也就是說 auto_clear_at_max: 只適用於無按鍵自動清屏。 當前實現是這樣處理嘛?

lotem commented 8 years ago

也許可以把配置項簡化爲:

speller:
   auto_clear: manual | auto | max_length
linzianxyz commented 8 years ago

看OS的手机版,已经实现了四码无重自动清、五码顶字清这两个功能,这两个不需要空格什么的。但目前rime的空格统一是上屏,不论是否有编码还是没有,这是rime自己的设置,一来OS认为,改动有点大; 二来,这是rime自己的特色,可以不用改。

linzianxyz commented 8 years ago

另外@lotem 建议更新速度可否再快一点?这几次的功能都是比较重要的更新,但是好像不是及时的编译……

osfans commented 8 years ago

@lotem 是的,打滿最大碼長無選,需要按空格清屏。@rimefans 用的就是這種,也就是下面的第二種。

speller:
   auto_clear: manual | auto | max_length

這個果然清晰。

以五筆最長4碼爲例,空碼確認鍵爲空格或下一碼 目前是將空格在composing &&!has_menu時映射爲Escape,直接改成空格清屏似乎改動較大,暫時就不改了。

  1. auto_clear:空碼按確認鍵清屏 # manual
  2. auto_clear && auto_clear_at_max:僅4碼空碼按確認鍵清屏
  3. auto_clear && auto_clear_commit:空碼自動清屏 #auto
  4. auto_clear && auto_clear_commit && auto_clear_at_max:僅4碼空碼自動清屏 #max_length

或許第4種情況沒人用,那就把第二種改成max_length。

另外,no_menu試驗過了,跟下面的效果一樣,英文時也會清屏。所以暫且不改了。

- { when: composing, accept: space, send: Escape }
- { when: has_menu, accept: space, send: space }
lotem commented 8 years ago

我反而觉得 4. 会比 2. 更有需求。

  1. 可以满足 2. 的需要。有什么理由在不足四码打空时反而要上屏编码字符呢。
osfans commented 8 years ago

有道理,我是用的1. 那就先加134這三種。

osfans commented 8 years ago

想起來了,似乎2.是給精確匹配(關閉漸進搜索)用的。比如,三碼爲空,四碼不爲空。 auto_select好像也有這個情況,所以纔有max_code_length吧?只在四碼時上屏。

osfans commented 8 years ago

或者應該這樣, enable_completion: false時,沒達到最長時,候選項數無效,自動上屏或自動清屏,都應該無效。 enable_completion: true時,判斷候選項數才有效。

linzianxyz commented 8 years ago

自动上 和自动清,必须发生在4码及+1后。另外,completion只起到 提示的作用,不应有其他作用,只要编码没有,手动清还是可以的。 发自我的小米手机

Osfans notifications@github.com编写:

或者應該這樣, enable_completion: false時,沒達到最長時,候選項數無效,自動上屏或自動清屏,都應該無效。 enable_completion: true時,判斷候選項數才有效。


Reply to this email directly or view it on GitHub: https://github.com/rime/librime/issues/60#issuecomment-153218444

lotem commented 8 years ago

@osfans 同意加入这个判断。如果好实现的话。

@rimefans completion 不仅起到提示的作用,而且自身就是可以上屏的候选字。当只存在这种候选字时,作为捷径避免输全编码,按空格上屏是期望的行为。即使不上屏,最多按空格键不做任何动作,因为并非处于不可继续输入的状态。

osfans commented 8 years ago

目前沒找到獲得table_translator實例的方法,只能通過config->GetBool獲得enable_completion

speller:
   auto_clear: manual | auto | max_length

上面的提交實現如下功能: auto:空碼自動清屏 manual:空碼按下一鍵確認清屏 max_length:達到最長碼時確認清屏

前兩個需要將enable_completion設爲true。

所以現在 @rimefans 只要設成 auto_clear: max_length 就好了。 安卓上的測試程序:https://github.com/osfans/trime/releases/download/v3.0-beta/trime-20151103-test.apk

linzianxyz commented 8 years ago

在speller: auto_select: true delimiter: "~" max_code_length: 4 auto_clear: manual | auto | max_length auto_clear: max_length 在translator设 enable_completion: true 这样设置的对吗? 结果是这样的: 首先是关于自动清屏。没有实现四码清屏,只有五码顶字清。 关于空格的作用,没有实现清屏,不论是三码还是四码,按下空格后都是编码上屏。 然后是将enable_completion: false 此时,自动清屏,也是五码清屏。四码不自动清。 空格也是同上。 目前

osfans commented 8 years ago

對的。

auto_clear: auto translator/enable_completion: true 這時自動清屏。

auto_clear: manual translator/enable_completion: true 這時手動頂字清屏。

至於空格,沒有做。還得用之前的方法,改default.yaml。

linzianxyz commented 8 years ago

manual 和顶字好像没有区别……

发自我的小米手机

Osfans notifications@github.com编写:

對的。

auto_clear: auto translator/enable_completion: true 這時自動清屏。

auto_clear: manual translator/enable_completion: true 這時手動頂字清屏。

至於空格,沒有做。還得用之前的方法,改default.yaml。


Reply to this email directly or view it on GitHub: https://github.com/rime/librime/issues/60#issuecomment-153258950

osfans commented 8 years ago

manual是只要空碼就頂的。真正的頂。

linzianxyz commented 8 years ago

来反馈BUG auto_clear: manual auto_clear: auto auto_clear: max_length 当设置auto及manual时 如果munal意图是空码就顶,那么我觉得这个还是不做的好。因为有的码在二三位是空的,但在第四码时则非空。举个例子来说,屌,当打nkm时,是空的,但四码nkmh则出字。如果空码就顶的话,那根本出不了这个字。 当仅仅设置manual时,三码为空时,此时不会清屏,但当输入第四码时(不论是正确的还是错的),第四码都起到清屏的作用。 当三者全都true时,正常。

osfans commented 8 years ago

所以你要設定enable_completion爲true,此時nkm會匹配nkmh。所以不爲空。所以不會清屏。

auto_clear三者只要設一個,不能同時設。

linzianxyz commented 8 years ago

了解了。以后欢迎找我试用

发自我的小米手机

Osfans notifications@github.com编写:

所以你要設定enable_completion爲true,此時nkm會匹配nkmh。所以不爲空。所以不會清屏。

auto_clear三者只要設一個,不能同時設。


Reply to this email directly or view it on GitHub: https://github.com/rime/librime/issues/60#issuecomment-153287958