I tried it with:
Logitech Attack-3
2-axis
11 button
Worked great! Looking at how you got it working I noticed the Joystick.pyd file and looked that up on the net. From what I saw on the pygame.org site that file is for exe’s only? Would it be much different to use your scripts in a regular blend file? I did notice that some of the commands you used to Joystick methods were different than the ones listed on Pygame…(the initialization method, for example, on Pygame is Joystick.init() not Joystick.initJoystick() as you have it)
Name: Microsoft PC-joystick driver
Number Axes: 4
Number Hats: 1
Number Balls: 0
Number Buttons: 12
not bad [it is a playstation 2 controller]
it does annoy me however that the pressure sensitive buttons [there are 8, 4 are for the d-pad] cannot work in windows… oh well [this is not a problem with SDL, but rather windows’ joystick interface].
Thanks…
here is an update, it has some bug fixes and I added a function to close
the joystick manually… the module automatically closes, so this is not a must
also I added short tutorial/docs on it…
I’m working on more support for the above specs and will update it in a few days
I did find however that with analog sticks the value isn’t set in stone
& it will be possiblle mimic presure sensitivity… at least i’m %90 sure
of that
======================Info==========================
Name: Microsoft PC-joystick driver
Number Axes: 2
Number Hats: 0
Number Balls: 0
Number Buttons: 10
get the new version here
Okay, the Joystick.pyd is the file that blender needs to be
able to find
now what this script does:
for each axis that is available, it will return two values,the first
being
a 1 or 0 depending on the direction and the second value being the range
of the axis
so an example would be
import Joystick
Joystick.initJoystick()
Joystick.pumpEvents()
upAxis = (1, -32768)
downAxis = (1, 32768)
leftAxis = (0, -32768)
rightAxis = (0, 32768)
#then its just a matter of assigning those values to your game events
allaxes = Joystick.thisAxis()
if allaxes == upAxis:
print "up axis is pressed"
#and the same with the buttons
button = Joystick.thisButton()
if button == 0:
print "button zero is pressed"
#In the latest version of this script I added a debug mode
#which would be
Joystick.Debug()
then each event processed will be printed to the console
I’m working on getting this more user friendly
if your having problems with it, post it here and i’ll see what i can do
to answer
snailrose: Excuse me if it seemed as though I was putting down or insulting your effort in writing this. I just get real irritated when people release script/add ons for blender and and do not explain how to use them. They seem to feel that since they can use the script anyone can. Well they were the ones who wrote the darn thing in the first place so no wonder they can use it. How about the rest of us mere mortals.