Can I set an input callback at run time? (INPUT_CALLBACK_DEFINE(touch_dev, touch_event_callback, NULL) #89415
-
Suppose I wish to setup the callback function for an input object at runtime, how do I do it? In this case, suppose the board (shield) has a PT911 touch controller on it, and I would like to have my own input controller handling If I look at the example: Has a callback defined:
Which is fine, in many cases, but suppose I wish to load this code using LLEXT. The INPUT_CALLBACK_DEFINE does not Is there some runtime API that can dynamically set this up? In our searching, we found something that looked like it might work using kscan: It sets up a callback like:
but it appears like kscan has been phased out. I am not seeing any examples of it anymore and if I add the lines:
to conf, the build fails. Is there some other mechanism? maybe something like the GPIO ones? Ones like: Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@fabiobaltieri might be able to chime in |
Beta Was this translation helpful? Give feedback.
-
Can't be done at the moment, but it'd be very easy to a static callback that goes through a dynamic list. Or just implement the whole thing in the subsystem and make it Kconfig optional, don't see a reason not to accept such a contribution. |
Beta Was this translation helpful? Give feedback.
Can't be done at the moment, but it'd be very easy to a static callback that goes through a dynamic list. Or just implement the whole thing in the subsystem and make it Kconfig optional, don't see a reason not to accept such a contribution.