mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
btnm, tabview: in LV_SIGNAL_FOCUS assume the last indev if not focused by the an indev
This commit is contained in:
parent
4c944f4050
commit
9a7b7f8511
@ -855,6 +855,12 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
#if LV_USE_GROUP
|
||||
lv_indev_t * indev = lv_indev_get_act();
|
||||
lv_indev_type_t indev_type = lv_indev_get_type(indev);
|
||||
|
||||
/*If not focused by an input device assume the last input device*/
|
||||
if(indev_type == LV_INDEV_TYPE_NONE) {
|
||||
indev_type = lv_indev_get_type(lv_indev_get_next(NULL));
|
||||
}
|
||||
|
||||
if(indev_type == LV_INDEV_TYPE_POINTER) {
|
||||
/*Select the clicked button*/
|
||||
lv_point_t p1;
|
||||
|
@ -750,9 +750,12 @@ static lv_res_t lv_tabview_signal(lv_obj_t * tabview, lv_signal_t sign, void * p
|
||||
}
|
||||
|
||||
if(sign == LV_SIGNAL_FOCUS) {
|
||||
|
||||
|
||||
lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());
|
||||
/*If not focused by an input device assume the last input device*/
|
||||
if(indev_type == LV_INDEV_TYPE_NONE) {
|
||||
indev_type = lv_indev_get_type(lv_indev_get_next(NULL));
|
||||
}
|
||||
|
||||
/*With ENCODER select the first button only in edit mode*/
|
||||
if(indev_type == LV_INDEV_TYPE_ENCODER) {
|
||||
#if LV_USE_GROUP
|
||||
|
Loading…
x
Reference in New Issue
Block a user