lv_obj_t*lv_indev_get_obj_act(void) Function Documentation void lv_indev_init(void) Initialize the display input device subsystem §lv_indev_read_task() void lv_indev_read_task(lv_task_t*task) Called periodically to read the input devices ...
()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")...
Embedded graphics library to create beautiful UIs for any MCU, MPU and display type. - lvgl/src/core/lv_indev_scroll.c at d67dd943cadb3d21a3d9488b6354f669e2e58c65 · lvgl/lvgl
一、首先创建需要响应的OBJ 以lvgl开关obj为例 lv_obj_t * sw; sw = lv_switch_create(lv_scr_act()); 二、给其添加事件 首先定义回调函数 static void event_handler(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); lv_obj_t * obj = lv_event_get_target(e); if(co...
_send(act, LV_EVENT_KEY, &c);// 发送处理按键事件,传递的参数是具体哪个按键lv_event_send(indev_obj_act, LV_EVENT_...,indev_act);// 模拟对对象的操作,比如按下事件---lv_xxx_createlv_obj_class_init_objlv_group_add_obj 3.10 基础对象的作用 基础对象是所有部件(对象)的基石,基础对象将所有...
(lv_scr_act(), font_normal, 0); if(disp_size == DISP_LARGE) { lv_obj_t * tab_btns = lv_tabview_get_tab_btns(tv); lv_obj_set_style_pad_left(tab_btns, LV_HOR_RES / 2, 0); lv_obj_t * logo = lv_img_create(tab_btns); LV_IMG_DECLARE(img_lvgl_logo); lv_img_set_...
//输入设备注册staticlv_indev_drv_t indev_drv;lv_indev_drv_init(&indev_drv);indev_drv.type=LV_INDEV_TYPE_POINTER;indev_drv.read_cb=LvTouchRead;lv_indev_drv_register(&indev_drv); 这其中,我们定义输入设备类型是POINTER,同时设置了回调函数。回调函数如下: ...
lv_indev_t*mouse_indev=lv_indev_drv_register(&indev_drv);//图像声明LV_IMG_DECLARE(mouse_cursor_icon);//创建光标对象lv_obj_t*cursor_obj=lv_img_create(lv_scr_act(),NULL);//设置光标图像的来源lv_img_set_src(cursor_obj,&mouse_cursor_icon);//链接显示驱动lv_indev_set_cursor(mouse_indev...
Object has been pressed for at least LV_INDEV_LONG_PRESS_TIME. Not called if dragged. LV_EVENT_LONG_PRESSED_REPEAT Called after LV_INDEV_LONG_PRESS_TIME in every LV_INDEV_LONG_PRESS_REP_TIME ms. Not called if dragged. LV_EVENT_CLICKED Called on release if not dragged (regardless ...
static void lv_btnmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e); static void draw_main(lv_event_t * e); static uint8_t get_button_width(lv_btnmatrix_ctrl_t ctrl_bits); static bool button_is_hidden(lv_btnmatrix_ctrl_t ctrl_bits); ...