Joystick buttons are always in the pressed state

Found an issue in SpiderBasic ? Please report it here !
Trion
Posts: 3
Joined: Mon Apr 03, 2023 8:39 pm

Joystick buttons are always in the pressed state

Post by Trion »

When I run this code the joystick buttons are always in the pressed state, am I doing something wrong or is this a bug?

Windows 11
SpiderBasic 2.51
The and same in Firefox version 123, Chrome version 121.0.6167.185 and Edge version 121.0.2277.128

Code: Select all

OpenScreen(800, 600, 32, "Test")

Procedure RenderFrame()
  NbJoysticks = InitJoystick()

  ClearScreen(0)
  
  If NbJoysticks
    If ExamineJoystick(0)
;       h = JoystickButton(0, 1)
;       Debug h
      
      If JoystickButton(0, 1)
        Debug ("Button 1")
      EndIf
      
      If JoystickButton(0, 2)
        Debug ("Button 2")
      EndIf
      
    EndIf
  Else
    Debug "No Joystick found"
  EndIf
  
  FlipBuffers() ; continue the rendering
EndProcedure

BindEvent(#PB_Event_RenderFrame, @RenderFrame())

FlipBuffers() ; start the rendering