Any good dual-stick joypad code solutions?

BlitzMax Forums/BlitzMax Programming/Any good dual-stick joypad code solutions?

Sokurah(Posted 2012) [#1]
I have a new game almost ready to go, but I really should implement dual-stick (Robotron style) joypad control first, but it's not easy - the two joypads I have return widely different results, so I'm never sure if whatever I come up with will work for anyone else.

I've looked at it a good while back, and there was some code for a Xbox 360 Controller, but I seem to remember that it didn't work on OSX (optimally it should work with both Windows & OSX), and would it work with other joypads anyway?

Is there something - ready made, that I can use, with minimum fuss, that'll work with most joypads, on both Windows & OSX? ...that would save me from the frustration of trying to reinvent the wheel...so to speak. :-)


PhotonTom(Posted 2012) [#2]
Have you already tried the Pub.FreeJoy module?


Sokurah(Posted 2012) [#3]
No, I have to admit I haven't. I remember reading that results from Pub.FreeJoy doesn't work consistently across platforms - being especially problematic on OSX, so I've skipped that.

Still, with a thoroughly made config program it should work with most joypads, but it's a lot to make - and definitely like reinventing the wheel. ;)

I've thought about "borrowing" the joypad configurator from Mark's GridWars (which should be okay if credited) - that should do it...if I can figure out how to use it. :-)


*(Posted 2012) [#4]
Sokurah: did you download the OSX driver for the XBox360 pad, IIRC OSX doesnt see it unless you do and when I last coded something to use it I found it worked very well after that.


*(Posted 2012) [#5]
http://dynamicsubspace.net/2011/05/14/xbox-360-controller-driver-for-mac-os-x-works-like-a-dream/


Captain Wicker (crazy hillbilly)(Posted 2012) [#6]
When I bought NuclearBasic, I got the xbox360 controller plugin free. It has a very nice rumble feature.


Sokurah(Posted 2012) [#7]
Okay, time for an update. :-)

Here's what I did. I took Mark's GridWars 2 joypad config code (which seems to be based on Pongo's Blitz Basic code) and stripped everything unnecessary from the code.

I then made a small 100 line program that calls it, and it compiles and works nicely on both Windows and OSX. The different platforms needs the Xbox 360 joypad to be configured differently, but the config program let's you do that easily and no changes to the code is necessary.

Now I'll see if I can implement it in the game itself, but that shouldn't be too hard how. :-)

The game, btw, is a remake of Black Widow. A Robotron-like vector shooter.
Read more about it here!.

...and here's a picture;