[Gambas-user] A fine afternoon for a good rant

Cedron Dawg cedron at exede.net
Thu Feb 28 21:45:21 CET 2019


That sounds quite reasonable, it was sort of the direction I was heading by trying to write a component in Gambas.

You should be able to cleave my code kind of cleanly to do that.  Or maybe somebody else could pick it up, I'm just not adept enough yet.  

The end goal is that a first time user should be able to find a joystick component (or perhaps we should start saying GamePad since they are way more prevalent) and be able to use it without too much difficulty.


----- Original Message -----
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

----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----


More information about the User mailing list