Add joystick button index boundary check. Increase max. button number to 128 (max. buttons supported by DirectInput).

This commit is contained in:
bruvzg 2022-01-10 13:43:44 +02:00
parent 5f7bbf4d33
commit 61ea8f8337
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
3 changed files with 8 additions and 4 deletions

View file

@ -2134,8 +2134,11 @@
<constant name="JOY_BUTTON_SDL_MAX" value="21" enum="JoyButton">
The number of SDL game controller buttons.
</constant>
<constant name="JOY_BUTTON_MAX" value="36" enum="JoyButton">
The maximum number of game controller buttons: Android supports up to 36 buttons.
<constant name="JOY_BUTTON_MAX" value="128" enum="JoyButton">
The maximum number of game controller buttons supported by the engine. The actual limit may be lower on specific platforms:
- Android: Up to 36 buttons.
- Linux: Up to 80 buttons.
- Windows and macOS: Up to 128 buttons.
</constant>
<constant name="JOY_AXIS_INVALID" value="-1" enum="JoyAxis">
An invalid game controller axis.