Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libinput: automatic device discovery #155

Closed
Johennes opened this issue Sep 3, 2021 · 3 comments · Fixed by #157
Closed

libinput: automatic device discovery #155

Johennes opened this issue Sep 3, 2021 · 3 comments · Fixed by #157

Comments

@Johennes
Copy link
Contributor

Johennes commented Sep 3, 2021

I'm working on an application that is meant to be run on many different types of devices which means I can't hard-code the /dev/input/event... paths because I don't know them at build time. It would be great if the libinput driver could provide an interface for automatically detecting touchscreens, pointer devices and keyboards.

I have some very rudimentary code here that basically just walks the /dev/input/event... files, makes a libinput call to determine the device capabilities and then filters the files based on that.

I'd be interested to know if you would consider adding something like this to lv_drivers? I think this could be beneficial to other users as well.

@kisvegabor
Copy link
Member

What if you simply do #define LIBINPUT_NAME my_find_input_dev()?

Anyway, I believe it'd be useful to add libinput_find_touch_dev(), libinput_find_mose_dev(), etc to libinput.c so that the user could use them as LIBINPUT_NAME.

Probably we'd need LIBINPUT_TOUCH_NAME, LIBINPUT_MOUSE_NAME, etc.

What do you think?

@Johennes
Copy link
Contributor Author

Johennes commented Sep 3, 2021

Yeah, this overlaps a little with #151.

Using it directly in the config file is an interesting idea! The functions I'm using so far return all devices of a certain type. We could maybe wrap them in another set of functions to return only the first device of a type, that shouldn't be too complicated.

Johennes added a commit to Johennes/lv_drivers that referenced this issue Sep 5, 2021
This adds new convenience functions to the libinput driver for
automatically detecting input devices of a certain type (such as
keyboards or touchscreens).

Closes: lvgl#155
@kisvegabor
Copy link
Member

Using it directly in the config file is an interesting idea! The functions I'm using so far return all devices of a certain type. We could maybe wrap them in another set of functions to return only the first device of a type, that shouldn't be too complicated.

Based on my last comment in #151, I think it'd be the approach now.

Johennes added a commit to Johennes/lv_drivers that referenced this issue Sep 5, 2021
This adds new convenience functions to the libinput driver for
automatically detecting input devices of a certain type (such as
keyboards or touchscreens).

Closes: lvgl#155
Johennes added a commit to Johennes/lv_drivers that referenced this issue Sep 6, 2021
This adds new convenience functions to the libinput driver for
automatically detecting input devices of a certain type (such as
keyboards or touchscreens).

Closes: lvgl#155
kisvegabor pushed a commit that referenced this issue Sep 9, 2021
This adds new convenience functions to the libinput driver for
automatically detecting input devices of a certain type (such as
keyboards or touchscreens).

Closes: #155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants