improve input method

This commit is contained in:
lixianjing 2024-06-12 18:06:13 +08:00
parent 67f34f062c
commit e98c586fbe
3 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,8 @@
# 最新动态
2024/06/12
* 修复中文输入法在输入超过15位拼音后多余的字符会直接输入到编辑框的bug(感谢泽武提供补丁)
2024/06/4
* 完善代码注释(感谢雨欣提供补丁)

View File

@ -165,7 +165,7 @@ ret_t input_engine_input(input_engine_t* engine, int key) {
}
} else {
if (engine->keys.size >= TK_IM_MAX_INPUT_CHARS) {
return RET_BAD_PARAMS;
return RET_SKIP;
}
if (engine->input != NULL) {

View File

@ -141,8 +141,9 @@ static ret_t input_method_dispatch_key_only(input_method_t* im, uint32_t key) {
ret_t input_method_dispatch_key(input_method_t* im, uint32_t key) {
return_value_if_fail(im != NULL, RET_BAD_PARAMS);
if (im->engine != NULL) {
if (key <= 128 && input_engine_input(im->engine, (char)key) == RET_OK) {
if (im->engine != NULL && key <= 128) {
ret_t ret = input_engine_input(im->engine, (char)key);
if (ret == RET_OK || ret == RET_SKIP) {
return RET_OK;
}
}