rime / librime

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

How to use rime_api_console with combo-pinyin #611

Closed eagleoflqj closed 1 year ago

eagleoflqj commented 1 year ago

Is your feature request related to a problem? Please describe. I've ported several rime official IMEs to web, see list: https://github.com/LibreService/my_rime/blob/master/schemas.json When I try combo-pinyin, it doesn't work as expected. I build rime_api_console on Ubuntu 22.10 and use plum to play with it on combo-pinyin.

$ ./rime_api_console 
initializing...
message: [0] [deploy] start
message: [0] [deploy] success
ready.

schema: combo_pinyin / 宮保拼音
status: 
(not composing)
su
schema: combo_pinyin / 宮保拼音
status: composing 
|[su]

As you can see there are no candidates shown. (fcitx5-rime+plum+combo-pinyin works perfectly) I can dig more into it myself but your help will definitely accelerate the process.

Describe the solution you'd like A sequence of key strokes sent to rime_api_console that can mock combo-pinyin.

lotem commented 1 year ago

Unlike most input methods which only test key press, Combo Pinyin wants to see both key down and key up events. So to complete a combo, input su{Release+s}{Release+u}.

eagleoflqj commented 1 year ago

Thanks! Successfully ported via https://github.com/LibreService/my_rime/commit/cc90faeabc9b4e1e6586f1b7bc6e73c3fdc50b3a