Add value change event calls for dragging
@@ -346,14 +346,19 @@ static lv_res_t lv_rotary_signal(lv_obj_t * rotary, lv_signal_t sign, void * par
if (ext->right_knob_area.y1 < p.y && p.y < ext->right_knob_area.y2) {
if (p.x > ext->last_drag_x && p.x < ext->right_knob_area.x2) {
+ ext->last_drag_x = p.x;
lv_rotary_set_value(rotary, lv_rotary_get_value(rotary) + 1, LV_ANIM_ON);
+ res = lv_event_send(rotary, LV_EVENT_VALUE_CHANGED, NULL);
+ if(res != LV_RES_OK) return res;
}
else if (p.x < ext->last_drag_x && p.x > ext->right_knob_area.x1) {
+ ext->last_drag_x = p.x;
lv_rotary_set_value(rotary, lv_rotary_get_value(rotary) - 1, LV_ANIM_ON);
+ res = lv_event_send(rotary, LV_EVENT_VALUE_CHANGED, NULL);
+ if(res != LV_RES_OK) return res;
}
}
- ext->last_drag_x = p.x;
}
else if(sign == LV_SIGNAL_RELEASED || sign == LV_SIGNAL_PRESS_LOST) {
ext->dragging = false;
