Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Screen 12
  2.  
  3. Dim x As Single
  4. Dim y As Single
  5. Dim buttons As Integer
  6. Dim result As Integer
  7. Dim a As Integer
  8.  
  9. Const JoystickID = 0
  10.  
  11. 'This line checks to see if the joystick is ok.
  12.  
  13. If GetJoystick(JoystickID,buttons,x,y) Then
  14.     Print "Joystick doesn't exist or joystick error."
  15.     Print
  16.     Print "Press any key to continue."
  17.     Sleep
  18.     End
  19. End If
  20.  
  21.  
  22. Do
  23.     result = GetJoystick(JoystickID,buttons,x,y)
  24.  
  25.     Locate 1,1
  26.     Print ;"result:";result;" x:" ;x;" y:";y;" Buttons:";buttons,"","",""
  27.    
  28.     'This tests to see which buttons from 1 to 27 are pressed.
  29.     For a = 0 To 26
  30.         If (buttons And (1 Shl a)) Then
  31.             Print "Button ";a;" pressed.    "
  32.         Else
  33.             Print "Button ";a;" not pressed."
  34.         End If
  35.     Next a
  36. Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement