LVGL v5.3 KB to TA question

Szia Gabor Hello

I am currently working on a source code based on lvgl 5.3. I don’t want to rebuild everything, too much work! I have a few problems with the keyboard and several text areas. I have a working solution for lvgl 6.0 in my original source, but it doesn’t work with 5.3, no events but actions.
Is it still possible to get the LVGL documentation 5.3? Or can you help me get this working again?

Old working Code LVGL6.0:

static lv_obj_t* kb;

static lv_obj_t* ta1;
static lv_obj_t* ta2;

static void kb_event_cb(lv_obj_t* event_kb, lv_event_t event)
	// Just call the regular event handler
	lv_kb_def_event_cb(event_kb, event);


static void ta_event_cb(lv_obj_t* ta, lv_event_t event)
	if (event == LV_EVENT_CLICKED) {
		// Focus on the clicked text area
		if (kb != NULL)
			lv_kb_set_ta(kb, ta);


In Function each TA:
lv_obj_set_event_cb(ta1, ta_event_cb);//Event Fensterwechsel
lv_obj_set_event_cb(ta2, ta_event_cb);//Event Fensterwechsel

and Keyboard static:
		//Tastatur erstellen neu mit Fenster wechsel
		kb = lv_kb_create(win, NULL);
		lv_obj_set_size(kb, 1080, 300);
		lv_obj_set_pos(kb, 100, 340);
		lv_obj_set_event_cb(kb, kb_event_cb); // Setting a custom event handler stops the keyboard from closing automatically
		lv_kb_set_ta(kb, ta1);// Focus it on one of the text areas to start
		lv_kb_set_cursor_manage(kb, true);// Automatically show/hide cursors on text areas

I tried various things with the lv_kb_def_action, but it was unsuccessful. Only the first TA is active and I can write, but jumping to others doesn’t work. I cannot use the lv_kb_def_action from the lv_kb.c, it is not recognized. If more information is required, just ask. Many thanks. Üdvözlet!

Here is the 5.3 documentation: (3.9 MB)

I just got it from this commit on lvgl/docs. Maybe that will be of help.

Thank you! Didn’t find it anymore…

But I need help, can’t find an example in the dcumentation for several text areas and keyboard, as above. Thanks to everyone who can help!

Problem solved! Took me a couple of hours but works perfectly with 5.3…
Actually simple but unfortunately there are no longer any examples for 5.3, many links no longer work. But I have it! :grinning: :grinning: :stuck_out_tongue_winking_eye:

static lv_res_t ta_event_action(lv_obj_t* ta)
	lv_ta_set_cursor_type(ta, LV_CURSOR_HIDDEN);
	lv_ta_set_cursor_type(ta, LV_CURSOR_BLOCK);
	lv_kb_set_ta(kb, ta);
	return LV_RES_OK;

In function for every text area:

lv_ta_set_action(ta1, ta_event_action);
lv_ta_set_action(ta2, ta_event_action);


:upside_down_face: :upside_down_face: Regards, Üdvözlet!