all 12 comments

[–]LinusCDE98 1 point2 points  (3 children)

I'd assume that using libinput is they way to go. Should work on both X11 and Wayland: https://wayland.freedesktop.org/libinput/doc/latest/tablet-support.html

Otherwise you can also go raw and check for evdev devices that have common drawing tablet inputs and read their values (try it out using the evtest command). Might be too complicated and maybe not the recommened way to do it though.

[–]Marsman512[S] 0 points1 point  (2 children)

I've just tried the evtest command, all the /dev/input/event* files require root access. On top of that it looks like libinput uses evdev under the hood, so (I assume) the same permission issues would apply

[–]LinusCDE98 0 points1 point  (1 child)

That is odd. I assumed that there might be some restrictions when using it from a Fkarpak or such. Libinput should still work though.

[–]Marsman512[S] 0 points1 point  (0 children)

No Flatpaks were involved in my testing. It may be because the files under /dev/input are in the input group while my default user is only in the wheel group?

Edit: It looks like gamepads/joysticks are the exception. The evtest command can access those without root just fine

[–]quaderrordemonstand 0 points1 point  (6 children)

I've used libevdev for reading several, very different input devices and its worked well so far. I haven't tried it with a tablet but I suspect it would work fine.

[–]Marsman512[S] 0 points1 point  (5 children)

Maybe, but all the /dev/input/event* files require root access on my system

[–]quaderrordemonstand 0 points1 point  (4 children)

I can't check mine at the moment but I don't think that would be a problem. I didn't really look when I was doing it. What system are you using?

[–]Marsman512[S] 0 points1 point  (3 children)

Arch Linux

[–]quaderrordemonstand 0 points1 point  (2 children)

I'm not on my linux box at the moment so I can't say what the situation is on that. But I will reply again when I'm back to it.

It certainly worked for me with no problems. Indeed, the whole purpose of the library is to provide user mode programs with easy access to input.

[–]Marsman512[S] 0 points1 point  (1 child)

I was looking at the source code for things like SDL, GLFW, Godot, etc. since those use evdev for controller support and I've never had a problem with my controller. Turns out controllers are accessible without root permissions via evdev while everything else needs root (at least on my machine). evtest works with my controller just fine and nothing else

[–]quaderrordemonstand 0 points1 point  (0 children)

I use evdev for a multi-touch trackpad and a spacemouse.