[haiku-development] Re: Joysticks in Haiku

  • From: "Carwyn" <cdj1000@xxxxxxx>
  • To: "Haiku Development" <haiku-development@xxxxxxxxxxxxx>
  • Date: Thu, 17 Mar 2011 00:09:21 +0000

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.

You should run listusb -v in Terminal to find your devices path, e.g 
/dev/bus/usb/0/1.  The app should then be run BeApp /dev/bus/usb/0/1

Carwyn

Other related posts: