btnm, tabview: in LV_SIGNAL_FOCUS assume the last indev if not focused by the an indev
This commit is contained in:
@@ -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
|
#if LV_USE_GROUP
|
||||||
lv_indev_t * indev = lv_indev_get_act();
|
lv_indev_t * indev = lv_indev_get_act();
|
||||||
lv_indev_type_t indev_type = lv_indev_get_type(indev);
|
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) {
|
if(indev_type == LV_INDEV_TYPE_POINTER) {
|
||||||
/*Select the clicked button*/
|
/*Select the clicked button*/
|
||||||
lv_point_t p1;
|
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) {
|
if(sign == LV_SIGNAL_FOCUS) {
|
||||||
|
|
||||||
|
|
||||||
lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());
|
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*/
|
/*With ENCODER select the first button only in edit mode*/
|
||||||
if(indev_type == LV_INDEV_TYPE_ENCODER) {
|
if(indev_type == LV_INDEV_TYPE_ENCODER) {
|
||||||
#if LV_USE_GROUP
|
#if LV_USE_GROUP
|
||||||
|
|||||||
Reference in New Issue
Block a user