When key release, textarea recv a click event

Important: unclear posts may not receive useful answers.

Before posting

  • Get familiar with Markdown to format and structure your post
  • Be sure to update lvgl from the latest version from the master branch.
  • Be sure you have checked the relevant part of the documentation.
  • If applicable use the Simulator to eliminate hardware related issues.

Delete this section if you read and applied the mentioned points.

Description

What MCU/Processor/Board and compiler are you using?

What LVGL version are you using?

V8.1

What do you want to achieve?

I am input something in textea , when KEY_ENTER is pressed by the keypad, textea recv twice click event when the key press and key release

What have you tried so far?

Code to reproduce

static void ta_event_cb(lv_event_t * e)
{
lv_indev_t * indev = lv_indev_get_act();
if(indev == NULL) return;
lv_indev_type_t indev_type = lv_indev_get_type(indev);

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_CLICKED ) { //&& indev_type == LV_INDEV_TYPE_ENCODER
    LV_LOG_USER("disp kb");
    lv_keyboard_set_textarea(kb, ta);
    lv_obj_clear_flag(kb, LV_OBJ_FLAG_HIDDEN);

// lv_group_focus_obj(kb);
// lv_group_set_editing(lv_obj_get_group(kb), kb);
lv_obj_set_height(tv, LV_VER_RES / 2);
lv_obj_align(kb, LV_ALIGN_BOTTOM_MID, 0, 0);
}

if(code == LV_EVENT_READY || code == LV_EVENT_CANCEL) {
    LV_LOG_USER("hid kb");
    lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);
    lv_obj_set_height(tv, LV_VER_RES);
}

if(code == LV_EVENT_KEY){
    LV_LOG_USER("ta key=%d", lv_event_get_key(e));
}

}

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

[A 51.959] [Info] (51.959, +6668) indev_keypad_proc: 10 key is pressed (in lv_indev.c line #412)
[A 51.959] [User] (51.959, +0) ta_event_cb: hid kb (in lv_demo_keypad_encoder.c line #224)
[A 51.961] [User] (51.961, +2) ta_event_cb: ta key=10 (in lv_demo_keypad_encoder.c line #230)
[A 51.963] [Info] (51.963, +2) flex_update: update 0x200b848c container (in lv_flex.c line #211)
[A 51.967] [Info] (51.967, +4) flex_update: update 0x200b8038 container (in lv_flex.c line #211)
[A 51.969] [Info] (51.969, +2) flex_update: update 0x200b8544 container (in lv_flex.c line #211)
[A 51.973] [Info] (51.973, +4) flex_update: update 0x200b8600 container (in lv_flex.c line #211)
[A 51.975] [Info] (51.973, +0) flex_update: update 0x200b848c container (in lv_flex.c line #211)
[A 51.975] [Info] (51.975, +2) flex_update: update 0x200b8038 container (in lv_flex.c line #211)
[A 51.977] [Info] (51.977, +2) flex_update: update 0x200b8878 container (in lv_flex.c line #211)
[A 51.981] [Info] (51.981, +4) flex_update: update 0x200b9558 container (in lv_flex.c line #211)
[A 51.983] [Info] (51.983, +2) flex_update: update 0x200b8544 container (in lv_flex.c line #211)
[A 51.987] [Info] (51.987, +4) flex_update: update 0x200b8600 container (in lv_flex.c line #211)
[A 52.083] [Info] (52.083, +96) indev_keypad_proc: 10 key is released (in lv_indev.c line #496)
[A 52.083] [User] (52.083, +0) ta_event_cb: disp kb (in lv_demo_keypad_encoder.c line #214)
[A 52.087] [Info] (52.087, +4) flex_update: update 0x200b848c container (in lv_flex.c line #211)
[A 52.091] [Info] (52.091, +4) flex_update: update 0x200b8038 container (in lv_flex.c line #211)
[A 52.095] [Info] (52.095, +4) flex_update: update 0x200b8544 container (in lv_flex.c line #211)
[A 52.099] [Info] (52.097, +2) flex_update: update 0x200b8600 container (in lv_flex.c line #211)
[A 52.099] [Info] (52.099, +2) flex_update: update 0x200b848c container (in lv_flex.c line #211)
[A 52.101] [Info] (52.101, +2) flex_update: update 0x200b8038 container (in lv_flex.c line #211)
[A 52.103] [Info] (52.103, +2) flex_update: update 0x200b8878 container (in lv_flex.c line #211)
[A 52.107] [Info] (52.107, +4) flex_update: update 0x200b9558 container (in lv_flex.c line #211)
[A 52.109] [Info] (52.109, +2) flex_update: update 0x200b8544 container (in lv_flex.c line #211)
[A 52.111] [Info] (52.111, +2) flex_update: update 0x200b8600 container (in lv_flex.c line #211)

the textarea should not recv a click event when key release

from indev_keypad_proc in lv_indev.c, we know key press enter key will produce a click event and key release produce a click event

From documentation we know

LV_EVENT_CLICKED Called on release if an object did not scroll (regardless of long press)

but when enter key is pressed it will produce a click event

every key can produce click event - but it happens only when the key is released