KyleBing / typepad

玫枫跟打器:五笔跟打器(网页版)
http://kylebing.cn/tools/typepad/
GNU General Public License v3.0
224 stars 46 forks source link

Use compositionstart and compositionend to detect IME preedit #26

Open xsrvmy opened 2 years ago

xsrvmy commented 2 years ago

At the moment, it appears that the detection of IME preedit is based on word boundaries. This does not work if characters such as ; are used as part of the input method (for example, some shuangpin schemes). It would be better to detect whether the IME is active by using the compositionstart and compositionend events so that error detection does not fire between these two events.

xsrvmy commented 2 years ago

PS. In addition to the semicolon, the schema I use (三码郑码) also uses the underscore _ in its preedit to represent spaces, and many rime schemas show additional information in the preedit, so I believe a proper fix is necessary, rather than just adding _ and ; to the list of ignored characters.