[Gambas-user] Gambas class to read a joystick

Benoit Minisini gambas at ...1...
Tue Mar 4 16:57:18 CET 2008


On mardi 4 mars 2008, Audiossis wrote:
> > ------------------------------
> >
> > Message: 3
> > Date: Mon, 3 Mar 2008 09:56:26 -0500
> > From: Rob <sourceforge-raindog2 at ...94...>
> > Subject: Re: [Gambas-user] Gambas class to read a joystick
> > To: gambas-user at lists.sourceforge.net
> > Message-ID: <200803030956.26368.sourceforge-raindog2 at ...94...>
> > Content-Type: text/plain;  charset="iso-8859-1"
> >
> > On Monday 03 March 2008 08:29, Benoit Minisini wrote:
> > > So, in File_Read, you must read the file descriptor by blocks:
> >
> > Thanks, I might as well write the joystick component in Gambas then.
> > How do you think it should be named?
> >
> > Rob
>
> Rob,
>     Sorry, it took me a little time to post to your request. I am
> another Gambas user (not a developer), but I have written a Gambas class
> file to make use of a C library called libusb. It would seem to me that
> you may benefit from this class file with your joystick issue if your
> joystick is not detected in a way that Gambas can otherwise use.
>
>     This library will let you write a user mode driver or program that
> will access almost any type of usb device, although it does have its
> limits (isochronous tranfers are not supported yet). However, that being
> said, if you know enough C to program a Gambas module, then you may be
> able to add isochronous support to this library for your own uses......?
> You could then build on my class file and get the joystick support you
> are looking for. Using libusb would allow you to bypass the HID driver
> altogether.
>
> Perhaps you could even base a Gambas module on the libusb library....?
>
> Just a suggestion.
>
> Ben
>
> (PS. Sorry for the double post Benoit, I keep forgetting to change the
> subject line......)

I think you shouldn't read usb directly, because the Linux kernel has 
implemented an abstraction layer with devices located in /dev/input. 
Apparently you have /dev/input/event? devices that send input events, and 
specific devices for mice, joystick, and other things I don't know. If the 
joystick/keyboard/mouse is USB or serial is managed by these drivers.

My 2 cents...

-- 
Benoit Minisini




More information about the User mailing list