Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase joystick max button number and fix crash. #56666

Merged
merged 1 commit into from
Jan 10, 2022

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Jan 10, 2022

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

Notes:

  • macOS joystick API do not have a defined button/axis limit.
  • Linux apparently is limited to 80 (see this kernel patch for 104 button device).
  • It's unlikely any device will have more buttons than supported on Windows.

Fixes #56203

@bruvzg bruvzg added this to the 4.0 milestone Jan 10, 2022
@bruvzg bruvzg requested review from a team as code owners January 10, 2022 11:52
@akien-mga akien-mga added cherrypick:3.4 cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Jan 10, 2022
… to 128 (max. buttons supported by DirectInput).
@akien-mga akien-mga merged commit e6cc0ff into godotengine:master Jan 10, 2022
@akien-mga
Copy link
Member

Thanks!

@bruvzg bruvzg deleted the joy_button_fix branch January 10, 2022 16:18
@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jan 12, 2022
@akien-mga
Copy link
Member

Cherry-picked for 3.4.3.

@akien-mga akien-mga changed the title Increase joystick button button number and fix crash. Increase joystick max button number and fix crash. Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Godot crashes on startup with joystick with more than JOY_BUTTON_MAX buttons
2 participants