Text Area widget re-entry problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Text Area widget re-entry problem

Jump to solution
1,780 Views
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 Kudos
1 Solution
1,753 Views
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);

}

}

View solution in original post

4 Replies
1,769 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello  mitchkapa,

Which chip do you used?

 

BR

Alice

0 Kudos
1,766 Views
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 Kudos
1,754 Views
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);

}

}

1,744 Views
mitchkapa
Contributor III

Thanks!

0 Kudos