This a small demo showing some of buttons and force of a joy stick and mouse buttons.
May not be the best coding for doing this but will give you numbers of buttons and give you a feel of the force applide.
rem Standard Setup Code
rem mouse buttons and Wingman and others controlers
sync on : sync rate 0 :
backdrop on
color backdrop rgb(0,0,0) : hide mouse
set text font "arial" : set text size 12 : set text transparent
rem makes number to say what value joy button is
dim number$(32)
for i = 0 to 32
number$(i)=str$(i+1)
next i
repeat
mc = mouseclick()
cls
text 0, 10, "mouse CLICK: " + str$(mc)
if (mc && 1) = 1 then text 0, 50, "LEFT"
if (mc && 2) = 2 then text 0, 60, "RIGHT"
if (mc && 3) = 3 then text 0, 70, "both"
if (mc && 4) = 4 then text 0, 80, "wheel button"
rem && does an LOGICAL AND operation! It's not the same like AND! It compares the values BITWISE...
rem Bits:
rem 010 && 101 = 000
rem 010 && 111 = 010
rem 101 && 101 = 101
rem Decimals:
rem 2 && 5 = 0
rem 2 && 7 = 2
rem 5 && 5 = 5
for i = 0 to 32
text 0+(i*10),120, str$(joystick fire x(i))
if joystick fire x(i)=1
text 0, 110, " fire CLICK: "+str$(i)
else
text 0, 110, " fire CLICK: "
endif
next i
rem check all 32 button
for f=0 to 32
if (joystick fire x(f) && 1) = 1 then text 0, 150+(f*10)," fire button "+ number$(f)
next f
rem check slider and make it a value from 0 to 256
if joystick slider a() then text 0, 290," fire slider a = "+str$(int(abs(joystick slider a()-65536)/256))
rem work out the angle of the hat button
hat=joystick hat angle (0)
text 0,360,"hat angle = "+str$(hat/100)
rem work out the twist angle
tz=joystick twist z()
text 0,380,"Twist z angle = "+str$(tz/256)
rem value of up and down -1000 to 1000
jy=joystick y()
text 0,390,"Joy y up down= "+str$(jy)
rem as above
jx=joystick x()
text 0,400,"Joy x left right= "+str$(jx)
rem if you have it
jz=joystick z()
text 0,410,"Joy z = "+str$(jz)
rem puts in force to stick if a power stick
text 300,10,"Press upkey to make force Up "
if upkey()
force up 100
endif
text 300,20,"Press downkey to make force Down "
if downkey()
force down 100
endif
text 300,30,"Press Leftkey to make force Left "
if leftkey()
force left 100
endif
text 300,40,"Press Rightkey to make force Right "
if rightkey()
force right 100
endif
rem as above but using the hat button
hat#=joystick hat angle (0)/100
if hat#<>0
force angle 100,hat#,10
endif
rem update screen
sync
until 1=2
I'm not getting you down am I, Ho Look! another fancy Door?