To use a PS3 pad as a joystick, down load the windows driver provided by Wraggster.
http://dl.qj.net/SIXAXIS-driver-for-PC-Tools-and-Utilities-PlayStation-3/pg/12/fid/11679/catid/518
Please not the following driver issues:
Motion sensing doesn't work yet.
D pad is treated as 4 buttons, not a hat control.
Numbering of the buttons is a bit strange.
Include functions : PS3Pad.dba
`***********************************
`* PlayStation(R)3 Pad Functions *
`***********************************
`* PS3Pad.dba Writen By Dave Mayes *
`***********************************
` Driver available from
` http://dl.qj.net/SIXAXIS-driver-for-PC-Tools-and-Utilities-PlayStation-3/pg/12/fid/11679/catid/518
` Thanks to Wraggster for providing the windows driver
` libusb-win32-filter-bin-0.1.10.1.exe must be run once to install the driver
` ps3sizaxis_en.exe must be run after pluging in the controller each time it is used
` Functions may be freely used in non-commercial software, or as a basis for your own routines
` Button numbering as returned by driver
` Select = 0
` L3 = 1
` R3 = 2
` Start = 3
` D Up = 4
` D Right = 5
` D Down = 6
` D Left = 7
` L2 = 8
` R2 = 9
` L1 = 10
` R1 = 11
` Triangle = 12
` Circle = 13
` X = 14
` Square = 15
` PS = 16
Function Is_PS3_Pad()
ps3 = 0
perform checklist for control devices
for c=1 to checklist quantity()
if checklist string$(c) = "PLAYSTATION(R)3 Controller"
ps3 = c
set control device checklist string$(c)
EndIf
next c
EndFunction ps3
Function PS3_LeftHorizontal()
ps3 = joystick X()
EndFunction ps3
Function PS3_LeftVertical()
ps3 = joystick Y()
EndFunction ps3
Function PS3_RightHorizontal()
ps3 = joystick Z()
EndFunction ps3
Function PS3_RightVertical()
ps3 = (joystick twist z() - 32768) /33
EndFunction ps3
Function PS3_Select()
ps3 = joystick fire x(0)
EndFunction ps3
Function PS3_L3()
ps3 = joystick fire x(1)
EndFunction ps3
Function PS3_R3()
ps3 = joystick fire x(2)
EndFunction ps3
Function PS3_Start()
ps3 = joystick fire x(3)
EndFunction ps3
Function PS3_Up()
ps3 = joystick fire x(4)
EndFunction ps3
Function PS3_Right()
ps3 = joystick fire x(5)
EndFunction ps3
Function PS3_Down()
ps3 = joystick fire x(6)
EndFunction ps3
Function PS3_Left()
ps3 = joystick fire x(7)
EndFunction ps3
Function PS3_L2()
ps3 = joystick fire x(8)
EndFunction ps3
Function PS3_R2()
ps3 = joystick fire x(9)
EndFunction ps3
Function PS3_L1()
ps3 = joystick fire x(10)
EndFunction ps3
Function PS3_R1()
ps3 = joystick fire x(11)
EndFunction ps3
Function PS3_Triangle()
ps3 = joystick fire x(12)
EndFunction ps3
Function PS3_Circle()
ps3 = joystick fire x(13)
EndFunction ps3
Function PS3_X()
ps3 = joystick fire x(14)
EndFunction ps3
Function PS3_Square()
ps3 = joystick fire x(15)
EndFunction ps3
Function PS3_PS()
ps3 = joystick fire x(16)
EndFunction ps3
Example
` PlayStation(R)3 Pad Demo
#Include "PS3Pad.dba"
cls
If Is_PS3_Pad() = 1
gosub test
else
print "Pad not found!"
print
Sleep 10000
endif
end
test:
while (PS3_L3() + PS3_R3()) < 2
cls
print joy$
print "Left X ", str$(PS3_LeftHorizontal())
print "Left Y ", str$(PS3_LeftVertical())
print "Right X ", str$(PS3_RightHorizontal())
print "Right Y ", str$(PS3_RightVertical())
print
print "Triangle ", PS3_Triangle()
print "Square ", PS3_Square()
print "Cricle ", PS3_Circle()
print "X ", PS3_X()
print "L1 ", PS3_L1()
print "L2 ", PS3_L2()
print "L3 ", PS3_L3()
print "R1 ", PS3_R1()
print "R2 ", PS3_R2()
print "R3 ", PS3_R3()
print "UP ", PS3_Up()
print "DOWN ", PS3_Down()
print "LEFT ", PS3_Left()
print "RIGHT ", PS3_Right()
print "START ", PS3_Start()
print "SELECT ", PS3_Select()
print "PS ", PS3_PS()
endwhile
return
Hope someone will find this useful.
Dave