Dz=JoystickAxisZ(0,#PB_Relative) et Dz=JoystickAxisZ(0,#PB_Absolute)
sur mon ThrustMaster T-Flight Stick X (On my ThrustMaster T-Flight Stick X)
la fonction concernant la rotation du manche dans l'axe des Z (Axe de Lacet ) (The function concerning the rotation of the stick in the Z axis (Lace axis))
Dz=JoystickAxisZ(0,#PB_Relative) me renvoi 1 ou -1
alors que (while )
Dz=JoystickAxisZ(0,#PB_Absolute) me renvoi rien du tout ! (Send me nothing at all!)
code exemple : (Example code:)
Code: Select all
; English forum: http://purebasic.myforums.net/viewtopic.php?t=8572&highlight=
; Author: waffle
; Date: 01. December 2003
;I did this to use a joystick with starfleet command
;works with windows too
;AOE has problems with it
;norms global mouser using joystick
Quit.l=0
If InitJoystick()=0
MessageRequester("Mouser Error","No controller detected",#MB_ICONSTOP)
End
EndIf
holdingX.l=0
holdingY.l=0
holddelayX.l=0
holddelayY.l=0
lbhold.l=0
rbhold.l=0
Repeat
If ExamineJoystick(0)
dx=JoystickAxisX(0,#PB_Absolute)
dy=JoystickAxisY(0,#PB_Absolute)
Dz=JoystickAxisZ(0,#PB_Relative) ; Absolute dont Work !!!!
bouton1=JoystickButton(0,1)
bouton2= JoystickButton(0,2)
bouton3=JoystickButton(0,3)
bouton4=JoystickButton(0,4)
bouton5=JoystickButton(0,5)
bouton6=JoystickButton(0,6)
bouton7=JoystickButton(0,7)
bouton8=JoystickButton(0,8)
bouton9=JoystickButton(0,9)
bouton10=JoystickButton(0,10)
bouton11=JoystickButton(0,11)
bouton12=JoystickButton(0,12)
If bouton1>0 Or bouton2>0
debug "bouton 1 " +str(bouton1)
debug "bouton2 " +str(bouton2)
Endif
If Dx>0 or DX<0
debug "X" +str(DX)
Endif
If Dy>0 or Dy<0
debug "Y"+str(DY)
Endif
If Dz>0 or Dz<0
debug "Z" +str(Dz)
Endif
Endif
Until Quit
; ExecutableFormat=Windows
; EOF