The freejoy module only lets us access these:
Const JOY_X=0<br>
Const JOY_Y=1<br>
Const JOY_Z=2<br>
Const JOY_R=3<br>
Const JOY_U=4<br>
Const JOY_V=5<br>
Const JOY_YAW=6<br>
Const JOY_PITCH=7<br>
Const JOY_ROLL=8<br>
Const JOY_HAT=9<br>
Const JOY_WHEEL=10<br>
Can we just call
Function JoyAnyAxis#( port=0, ax )
SampleJoy port
Return joy_axis[port*16 + ax]
End Function
for ax = 11,12,13,14 and 15 ?
Reason is: there are some controls not yet accounted for (JoySlider() ?)
Anyone have an axis they can test that on?
joytest.bmx
Const JOY_X=0<br>
Const JOY_Y=1<br>
Const JOY_Z=2<br>
Const JOY_R=3<br>
Const JOY_U=4<br>
Const JOY_V=5<br>
Const JOY_YAW=6<br>
Const JOY_PITCH=7<br>
Const JOY_ROLL=8<br>
Const JOY_HAT=9<br>
Const JOY_WHEEL=10<br>
Can we just call
Function JoyAnyAxis#( port=0, ax )
SampleJoy port
Return joy_axis[port*16 + ax]
End Function
for ax = 11,12,13,14 and 15 ?
Reason is: there are some controls not yet accounted for (JoySlider() ?)
Anyone have an axis they can test that on?
joytest.bmx
?MacOS Framework BRL.GLMax2D ?Win32 Framework BRL.D3D7Max2D ? Import PUB.FreeJoy Import BRL.Retro ?Win32 SetGraphicsDriver D3D7Max2DDriver() ? 'If Not JoyCount() RuntimeError "No joystick found!" Graphics 640,480 Function drawprop(n$,p#,y) Local w DrawText n$,0,y w=Abs(p)*256 If p<0 DrawRect 320-w,y,w,16 Else DrawRect 320,y,w,16 EndIf End Function Local t=0 While Not KeyHit(KEY_ESCAPE) Cls SetColor 255,255,255 Local n=JoyCount() DrawText "joycount="+n,0,0 DrawText "JoyName(0)="+JoyName(0),0,20 DrawText "JoyButtonCaps(0)="+Bin$(JoyButtonCaps(0)),0,40 DrawText "JoyAxisCaps(0)="+Bin$(JoyAxisCaps(0)),0,60 For Local i=0 To 31 SetColor 255,255,255 If JoyDown(i) SetColor 255,0,0 DrawOval i*16,80,14,14 Next SetColor 255,255,0 drawprop "JoyX=",JoyX(0),100 drawprop "JoyY:",JoyY(0),120 drawprop "JoyZ:",JoyZ(0),140 drawprop "JoyR:",JoyR(0),160 drawprop "JoyU:",JoyU(0),180 drawprop "JoyV:",JoyV(0),200 drawprop "JoyHat:",JoyHat(0),220 drawprop "JoyWheel:",JoyWheel(0),240 drawprop "JoyAxis 11:",JoyWhat(0,11),260 drawprop "JoyAxis 12:",JoyWhat(0,12),280 drawprop "JoyAxis 13:",JoyWhat(0,13),300 drawprop "JoyAxis 14:",JoyWhat(0,14),320 drawprop "JoyAxis 15:",JoyWhat(0,15),340 drawprop "JoyAxis 16:",JoyWhat(0,16),360 DrawRect 0,380,t,10 t=(t+1)&511 Flip Wend End Function JoyWhat#( port=0, axis ) SampleJoy port Return joy_axis[port*16+axis] End Function