[haiku-development] Re: Joysticks in Haiku

  • From: "Carwyn" <cdj1000@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 17 Mar 2011 01:19:08 +0000

> Hi,
> 
> --- On Wed, 3/16/11, Carwyn <cdj1000@xxxxxxx> wrote:
> 
> > Hi All,
> > 
> > I've been doing some experimenting and have thought of an
> > idea,  how  about using the USBKit from userland to get the
> > info for joysticks, gamepads etc. Any thoughts on this idea?.
> > 
> > I've tested my idea and can read a Gravis Gamepad Pro status
> > and also a Xbox 360 controller using the USBKit InterruptTransfer
> > function.  Would this be an acceptable way to implement BJoystick
> > etc at least for USB devices.
> > 
> > This is done in linux's Xbox/Xbox360 USB Gamepad Userspace
> > Driver which was made by Ingo Ruhnke.  All that needs to be
> > done is get the endpoint for the device and InterruptTransfer
> > 32 bytes, and all the buttons, axes etc are available.
> > 
> > I'll upload my code to haiku dev so someone can test
> > it,  i've only tested a wired Xbox 360 controller.
>  
> It is preferred that you attach a patch to a ticket. See
> http://dev.haiku-os.org/wiki/SubmittingPatches#Preparingtocreatepatchfile
> > 
> Regarding your previous code attachments, did you write the 
> GamepadDevice.cpp and header?  If so, you assigned the copyright to 
Michael Lotz instead of to Haiku, Inc. or yourself.  Either would be 
fine.
> 
> Also, Kirilla and I made a working patch from the zipped code that 
> you attached to http://dev.haiku-os.org/ticket/7354, but we were 
uncertain as to what the patch/code actually did. I applied the patch 
to r40968 but did not see any change in how Haiku handled gamepads. I 
could not setup a gamepad in neither BeSMSPlus 0.94, nor BeSnesx 1.41.
> 
> Thanks for your contributions. Please let me know how I could help 
> test your changes.
> 
> -D
> 

Disraeli,

I'm sorry but the GamepadDevice patch won't work on it's own without my 
BJoystick modifications and they aren't ready yet,  i'm just 
experimenting with a few things and i'm going to upload some stuff to 
my website which you can download if you like,  the BJoystick can be 
used as a seperate library in an apps folder.  I've uploaded my 
userland joystick xbox360 test app here http://www.cemist.f2s.com/xbox360.zip

I'll change the GamepadDevice.cpp to be my copyright or Haiku,  I want 
to make sure that my code does things the right way before moving 
forward and submitting patches which could be useless.  I think the 
userland joystick is a good idea, but others may not.  

I'll upload my BJoystick code tomorrow to my website and then you can 
test your joystick with the GamepadDevice.cpp.

Carwyn


Other related posts: