; JoyDown Example ; --------------- Graphics 640,480,0,2 SetBuffer BackBuffer() While Not KeyDown(1) Cls If JoyType()=0 Then Text 0,0,"Esc: exit" Text 0,60,"No joystick detected - plug in a gamepad to try this example." Text 0,80,"With one attached, the lights below follow the held buttons." Else Text 0,0,"Hold joystick buttons 1-8 Esc: exit" End If ; JoyDown returns 1 while the numbered button is HELD - test ; each button separately. ; (Compare JoyHit, which reports each press only once.) held$="" For b=1 To 8 If JoyDown(b) Then Color 255,220,0 Oval 60+(b-1)*70,200,50,50,True held$=held$+b+" " Else Color 90,90,90 Oval 60+(b-1)*70,200,50,50,False End If Color 255,255,255 Text 85+(b-1)*70,270,Str(b),True Next Text 0,20,"Buttons held (JoyDown): "+held$ Flip Wend End