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 !?
Hang if JoystickButton() request state of NON existing button
Re: Hang if JoystickButton() request state of NON existing button
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
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
Christos