Experimental support for USB Joysticks on Solaris

Greetings,

I wrote an experimental SDL_sysjoystick.c (http://musclorr.free.fr/contrib/SDL_sysjoystick.c) that will support USB Joysticks on Solaris without any kernel patch needed.

Since this is purely experimental, I’m not sure it should be included as is in the source code. Anyway, joystick support is a must have and I’m happy to have made it work on my laptop !

Summary:

Code:

  • Experimental support for USB joysticks in libSDL on Solaris.
  • This is purely experimental, use at your own risk !*
  • On Solaris 10, no /dev/js or equivalent is available and the libusb
  • installed does not recognize USB joysticks.
  • However, it is possible to read a device file (located for example in
  • /devices/pci at 0,0/pci10cf,11ab at 1d,1/input at 1:hid_1_4) to get the
  • state of each button.

Does this work with SDL 1.3?

Is there a way you can scan for joystick devices without requiring someone
to set the SDL_JOYSTICK_DEVICE environment variable?

Do you give me permission to release your code with SDL 1.3 and future
versions of SDL under both the LGPL and a closed-source commercial
license?

Thanks!On Sun, Mar 13, 2011 at 1:28 AM, frigault <rigault.francois+libsdl at gmail.com wrote:

Greetings,

I wrote an experimental SDL_sysjoystick.chttp://musclorr.free.fr/contrib/SDL_sysjoystick.cthat will support USB Joysticks on Solaris without any kernel patch needed.

Since this is purely experimental, I’m not sure it should be included as is
in the source code. Anyway, joystick support is a must have and I’m happy to
have made it work on my laptop !

Summary:

Code:

  • Experimental support for USB joysticks in libSDL on Solaris.
  • This is purely experimental, use at your own risk !
  • On Solaris 10, no /dev/js or equivalent is available and the libusb
  • installed does not recognize USB joysticks.
  • However, it is possible to read a device file (located for example in
  • /devices/pci at 0,0/pci10cf,11ab at 1d,1/input at 1:hid_1_4) to get the
  • state of each button.

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and CEO, Galaxy Gameworks

This has not been tested with SDL1.3 yet and I will probably not have the opportunity to test it again. I might have a second look at it on Solaris Express 11 and will try with SDL1.3, although I hope there is something cleaner already existing in Solaris11 to avoid polling the joystick state.

It’s of course possible to walk the /devices/ folder inside the SDL code, but the biggest improvement is certainly to avoid hardcoding joystick specific config in the code :slight_smile: This is certainly a piece of code not ready for inclusion in a mature product like libSDL.

You have permission to release it under LGPL, closed-source commercial license. To repeat myself, this is not production code, but it might still be considered useful to have it in a README file somewhere.

F[/list]

Okay, thanks!On Wed, Mar 16, 2011 at 4:35 AM, frigault <rigault.francois+libsdl at gmail.com wrote:

This has not been tested with SDL1.3 yet and I will probably not have the
opportunity to test it again. I might have a second look at it on Solaris
Express 11 and will try with SDL1.3, although I hope there is something
cleaner already existing in Solaris11 to avoid polling the joystick state.

It’s of course possible to walk the /devices/ folder inside the SDL code,
but the biggest improvement is certainly to avoid hardcoding joystick
specific config in the code [image: Smile] This is certainly a piece of
code not ready for inclusion in a mature product like libSDL.

You have permission to release it under LGPL, closed-source commercial
license. To repeat myself, this is not production code, but it might still
be considered useful to have it in a README file somewhere.

F[/list]


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and CEO, Galaxy Gameworks