diff --git a/docs/changes.md b/docs/changes.md index cf30fec2d..01a4a5838 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -2,6 +2,7 @@ 2024/06/14 * 给widget_visible_in_scroll_view.inc增加注释和修复默认滚动规则的算法(感谢智明提供补丁) + * 修复3key5key页面不能自动聚焦的功能(感谢智明提供补丁) 2024/06/13 * 去掉不必要的参数有效性检查(感谢朝泽提供补丁) diff --git a/src/widgets/default_focused_child.inc b/src/widgets/default_focused_child.inc index 5d6c738f3..2e48e9ba8 100644 --- a/src/widgets/default_focused_child.inc +++ b/src/widgets/default_focused_child.inc @@ -154,7 +154,7 @@ static ret_t default_focused_child_set_target_focused(str_t* tag, widget_t* widg if (target == target->parent->target) { break; } - pointer_event_init((event_t*)&event, EVT_POINTER_LEAVE, target->parent->target, ids->last_x, ids->last_y); + pointer_event_init(&event, EVT_POINTER_LEAVE, target->parent->target, ids->last_x, ids->last_y); widget_dispatch_leave_event(target->parent->target, &event); target->parent->target = target; diff --git a/src/widgets/pages.c b/src/widgets/pages.c index 14c3259fa..cd3bf0ba8 100644 --- a/src/widgets/pages.c +++ b/src/widgets/pages.c @@ -51,11 +51,12 @@ static ret_t pages_save_target(widget_t* widget) { static ret_t pages_on_idle_set_target_focused(const idle_info_t* idle) { pages_t* pages = NULL; + system_info_t* info = system_info(); return_value_if_fail(idle != NULL, RET_BAD_PARAMS); pages = PAGES(idle->ctx); ENSURE(pages); - if (pages->widget.focused) { + if (pages->widget.focused || info->keyboard_type == KEYBOARD_3KEYS || info->keyboard_type == KEYBOARD_5KEYS) { default_focused_child_set_target_focused(&(pages->str_target), WIDGET(pages)); }