How to set object focus?

I want to do this:
The user clicks the button to pop up a container. When the user taps the space outside the container, the container automatically closes.
I found LV_EVENT_DEFOCUSED events, so I wanted to focus the container.
This allows me to close the container in LV_EVENT_DEFOCUSED event.

If I click btn1, how to set focus to cont?

/*You code here*/
static void btn_event_cb(lv_obj_t *btn, lv_event_t event)
    if (event == LV_EVENT_CLICKED) {
        lv_obj_t *cont = lv_cont_create(lv_scr_act(), NULL);
        lv_obj_set_size(cont, 100, 100);

void test1(void)
  lv_obj_t *btn1 = lv_btn_create(lv_scr_act(), NULL);
  lv_obj_set_event_cb(btn1, btn_event_cb);