feat(ime_pinyin): add API to support 9-key input mode (#3447)

* feat(ime_pinyin): add API to support 9-key input mode

* some optimizations for lv_ime_pinyin

* Update lv_example_ime_pinyin_2.c

* Update src/extra/others/ime/lv_ime_pinyin.h

Co-authored-by: YobeZhou <smilezyb@163.com>
Co-authored-by: Yobe Zhou <33565334+YobeZhou@users.noreply.github.com>
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
100ask
2022-07-06 15:04:53 +08:00
committed by GitHub
parent 73114028d3
commit 10e0b7a1ad
10 changed files with 572 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
# Pinyin IME
Pinyin IME provides API to provide Chinese Pinyin input method (Chinese input) for keyboard object. You can think of `lv_ime_pinyin` as a Pinyin input method plug-in for keyboard objects.
Pinyin IME provides API to provide Chinese Pinyin input method (Chinese input) for keyboard object, which supports 26 key and 9 key input modes. You can think of `lv_ime_pinyin` as a Pinyin input method plug-in for keyboard objects.
Normally, an environment where [lv_keyboard](/widgets/extra/keyboard) can run can also run `lv_ime_pinyin`. There are two main influencing factors: the size of the font file and the size of the dictionary.
@@ -8,7 +8,7 @@ Normally, an environment where [lv_keyboard](/widgets/extra/keyboard) can run ca
<summary>中文</summary>
<p>
`lv_ime_pinyin`为[键盘](/widgets/extra/keyboard)组件提供汉语拼音输入法(中文输入)的功能(后文简称为拼音输入法)。您可以将 `lv_ime_pinyin` 看成是键盘组件的汉语拼音输入法插件。
`lv_ime_pinyin`为[键盘](/widgets/extra/keyboard)组件提供汉语拼音输入法(中文输入)的功能(后文简称为拼音输入法)支持26键和9键输入模式。您可以将 `lv_ime_pinyin` 看成是键盘组件的汉语拼音输入法插件。
一般情况下,只要是[键盘](/widgets/extra/keyboard)组件能运行的环境 `lv_ime_pinyin` 也能运行。有两个影响因素:字库的大小和词库的大小。
@@ -118,6 +118,20 @@ After writing a dictionary according to the above dictionary format, you only ne
lv_100ask_pinyin_ime_set_dict(pinyin_ime, your_pinyin_dict);
```
## Input modes
`lv_ime_pinyin` supports 26 key and 9 key input modes. The mode switching is very simple, just call the function `lv_ime_pinyin_set_mode`. If the second parameter of function `lv_ime_pinyin_set_mode` is' 1 ', switch to 26 key input mode; if it is' 0', switch to 9 key input mode, and the default is' 1 '.
<details>
<summary>中文</summary>
<p>
`lv_ime_pinyin` 支持26键和9键输入模式。模式的切换非常简单只需调用函数 `lv_ime_pinyin_set_mode` 即可。如果函数 `lv_ime_pinyin_set_mode` 的第2个参数为 `1` 则切换到 26 键输入模式,如果为 `0` 则切换到 9 键输入法模式,默认为 `1`
</p>
</details>
## Example
```eval_rst