[Gambas-user] A fine afternoon for a good rant
Benoît Minisini
g4mba5 at gmail.com
Thu Feb 28 21:36:43 CET 2019
Le 28/02/2019 à 21:19, Cedron Dawg a écrit :
> You gotta admit that that is not obvious.
I admit.
>
> Anyway, the source I sent you is pretty much an evdev wrapper. The
> only things joystick specific about it are the file names it looks
> for and how the return values are handled, e.g. the Gambas events
> raised.
>
My proposal was to make the C code a non-specific interface to
livevdev, with the device specific thing in the Gambas part of the
component.
For example, gb.dbus is designed a bit like that.
So, concretely, we could imagine a "Joystick" class written in Gambas
that can enumerate all joysticks with some heuristic like in your code,
opens the device file and watch it, send the file descriptor to the C
part, and calls the C part from the read watch handler.
The C part should mainly be a thin layer on libevdev. All the file
opening and descriptor watching is done from the Gambas part.
I think things would be easier that way. What do you think?
--
Benoît Minisini
More information about the User
mailing list