scroll_throw_vect.y + indev->pointer.vect.y) / 2; This assumes that indev_proc_press() is called at a roughly fixed interval. But if an input driver with LV_INDEV_MODE_EVENT delivers events much more quickly (like SDL does), the scroll vector decays to 0 almost immediately....
+ lv_indev_t * indev = lv_indev_active(); lv_point_t p; lv_indev_get_vect(indev, &p); @@ -364,6 +368,8 @@ static void lv_roller_event(const lv_obj_class_t * class_p, lv_event_t * e) } } else if(code == LV_EVENT_RELEASED || code == LV_EVENT_PRESS_LOST) { ...
lv_obj_get_coords(talabel, &label_coords); lv_point_t point_act, vect_act; lv__get_point(click_source, &point_act); lv_indev_get_vectclick_sourcevect_act); if(point_actx < 0 || point_act.y < 0) return; /*Ignore from keypad*/ lv_point_t relpos;...
1.2、示例2 #include "../../lv_examples.h" #if LV_BUILD_EXAMPLES static void drag_event_handler(lv_event_t * e) { lv_obj_t * obj = lv_event_get_target(e); lv_indev_t * indev = lv_indev_active(); if(indev == NULL) return; lv_point_t vect; lv_indev_get_vect(indev, &...
#define LV_MEM_POOL_EXPAND_SIZE 0 /** Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too. */ #define LV_MEM_ADR 0 /**< 0: unused*/ /* Instead of an address give a memory allocator that will be called to get a me...
• Be sure lv_disp_t, lv_indev_t and lv_fs_drv_t are global or static. • Be sure your display works without LVGL. E.g. paint it to red on start up. • Enable Logging • Enable asserts in lv_conf.h (LV_USE_ASSERT_...) • If you use an RTOS – increase the ...
static void drag_event_handler(lv_event_t * e) { lv_obj_t * obj = lv_event_get_target(e); lv_indev_t * indev = lv_indev_get_act(); if(indev == NULL) return; lv_point_t vect; lv_indev_get_vect(indev, &vect); lv_coord_t x = lv_obj_get_x(obj) + vect.x; lv_coor...
Embedded graphics library to create beautiful UIs for any MCU, MPU and display type. - lvgl/src/core/lv_indev_scroll.c at 6acbdaa53d941b891db377e65111bd999f04631d · lvgl/lvgl
Embedded graphics library to create beautiful UIs for any MCU, MPU and display type. - lvgl/src/core/lv_indev_scroll.c at 8ed8542681d808e7719a2247ce2e267ba14792c4 · lvgl/lvgl
()indev.get_vect(vect)x=obj.get_x()+vect.xy=obj.get_y()+vect.yobj.set_pos(x,y)mem.now()## Make an object dragable.#obj=lv.obj(lv.scr_act())obj.set_size(150,100)obj.add_event_cb(drag_event_handler,lv.EVENT.PRESSING,None)label=lv.label(obj)label.set_text("Drag me")...