Text Area widget re-entry problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Text Area widget re-entry problem

跳至解决方案
3,443 次查看
mitchkapa
Contributor III

I am having a problem with the Text Area Widget in my GUI. When the TA Widget is tapped for the first time the keyboard immediately opens.  But once the keyboard has been closed (either with the keyboard button or check button) it is very difficult to get the keyboard to re-appear.  It takes many touches of the TA Widget for the keyboard to come back.  Perhaps the target touch area has been reduced to a very small target I haven't been able to tell that with certainty yet.

If I leave the screen with that TA Widget and return to it the first tap to bring up the keyboard always works. But again after the first time it is very difficult after that.

0 项奖励
回复
1 解答
3,416 次查看
zhenhualuo
NXP Employee
NXP Employee

Hi mitchkapa, 

Currently the keyboard will open when FOCUS event is triggered for TA, so you can click any area outside of TA and click TA area again to make keyboard appear. To open keyboard when clicking TA, please update ta_event_cb function to the following in setup_scr_screen.c. 

static void ta_event_cb(lv_event_t *e)
{

lv_event_code_t code = lv_event_get_code(e);
lv_obj_t *ta = lv_event_get_target(e);
lv_obj_t *kb = lv_event_get_user_data(e);
if (code == LV_EVENT_FOCUSED || code == LV_EVENT_CLICKED)
{

lv_keyboard_set_textarea(kb, ta);
lv_obj_move_foreground(kb);
lv_obj_clear_flag(kb, LV_OBJ_FLAG_HIDDEN);

}
if (code == LV_EVENT_DEFOCUSED)
{

lv_keyboard_set_textarea(kb, NULL);
lv_obj_move_background(kb);
lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);

}

}

在原帖中查看解决方案

4 回复数
3,432 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello  mitchkapa,

Which chip do you used?

 

BR

Alice

0 项奖励
回复
3,429 次查看
mitchkapa
Contributor III

I am using GUI Guider 1.4.0 -> LVGL v8.2.0 -> LPC54S018

I am able to recreate the problem with the Simulator (C) or running the code on my development board.

0 项奖励
回复
3,417 次查看
zhenhualuo
NXP Employee
NXP Employee

Hi mitchkapa, 

Currently the keyboard will open when FOCUS event is triggered for TA, so you can click any area outside of TA and click TA area again to make keyboard appear. To open keyboard when clicking TA, please update ta_event_cb function to the following in setup_scr_screen.c. 

static void ta_event_cb(lv_event_t *e)
{

lv_event_code_t code = lv_event_get_code(e);
lv_obj_t *ta = lv_event_get_target(e);
lv_obj_t *kb = lv_event_get_user_data(e);
if (code == LV_EVENT_FOCUSED || code == LV_EVENT_CLICKED)
{

lv_keyboard_set_textarea(kb, ta);
lv_obj_move_foreground(kb);
lv_obj_clear_flag(kb, LV_OBJ_FLAG_HIDDEN);

}
if (code == LV_EVENT_DEFOCUSED)
{

lv_keyboard_set_textarea(kb, NULL);
lv_obj_move_background(kb);
lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);

}

}

3,407 次查看
mitchkapa
Contributor III

Thanks!

0 项奖励
回复