Page 1 of 1

Hang if JoystickButton() request state of NON existing button

Posted: Wed Jun 26, 2024 9:53 pm
by plouf
if i use JoystickButton() and request state of joystick's existing button works as expected
but if i ask state of non existing button (for example the 3rd button in a 2 button joystick) debugger call and hangs

however there is no native way to find how many button joystick has !?

Re: Hang if JoystickButton() request state of NON existing button

Posted: Sun Jun 30, 2024 8:16 am
by plouf
in the meantime the following code can return the numbers of buttons in joypad
note have to use it ONLY if Initjoystick() returns that the joypad is connnected

Code: Select all

   
    ! var v_buttons1;
    ! v_buttons1 = spider.joystick.gamepads[0].buttons.length;
    Debug buttons1