Git Product home page Git Product logo

Comments (5)

liamHowatt avatar liamHowatt commented on June 5, 2024

Hey, I can't seem to get the callback to fire even before creating more screens. Could you please share a code snippet that works for getting the event? I'm also using SDL.

from lvgl.

kisvegabor avatar kisvegabor commented on June 5, 2024

LV_EVENT_PRESSED is not propagated to displays. It shall be used with a widget. E.g.

lv_obj_add_event_cb(scr, event_handler, LV_EVENT_PRESSED, nullptr);

from lvgl.

sliang951753 avatar sliang951753 commented on June 5, 2024

LV_EVENT_PRESSED is not propagated to displays. It shall be used with a widget. E.g.

lv_obj_add_event_cb(scr, event_handler, LV_EVENT_PRESSED, nullptr);

However, if I want to handle the global touch event, I have to put my code to every created screen.
Another use case is I can easily hook the touch event on display if it can handle the touch event, and then I can implement the disable / enable touch feature. I can prevent the touch event being dispatched to the screens.

Although I can directly get the touch event from the indev, but I think its better to make all application code to depends on LVGL library so that it can be cross-platform.

from lvgl.

sliang951753 avatar sliang951753 commented on June 5, 2024

Hey, I can't seem to get the callback to fire even before creating more screens. Could you please share a code snippet that works for getting the event? I'm also using SDL.

Sorry for confuse you, actually it doesn't work. The display object cannot receive the touch event as kisvegabor metioned.

from lvgl.

sliang951753 avatar sliang951753 commented on June 5, 2024

I found an alternative way to receive the global touch event. That is lv_indev_add_event_cb(). So, I closed this issue.

from lvgl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.