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

Move joystick-axis-to-button simulation out of JoystickHandler #5278

Merged
merged 2 commits into from
Jun 30, 2022

Conversation

Susko3
Copy link
Member

@Susko3 Susko3 commented Jun 29, 2022

This will allow AndroidJoystickHandler (coming soon) to reuse this logic without code duplication.
Inheritance is not an option as AndroidInputHandler is used on Android.

This code does look a bit dubious as JoystickButtonInput.Apply is called within JoystickAxisInput.Apply, but the current order of events is preserved.

KeyCombination does have a similar scroll delta to button conversion, but putting the logic there will break existing JoystickButton.JoystickAxisN usages.

@peppy
Copy link
Member

peppy commented Jun 30, 2022

Does this mean the android joystick handler will need to have its own implementation of the deadzone?

@Susko3
Copy link
Member Author

Susko3 commented Jun 30, 2022

I plan to make rescaleByDeadzone internal static to reuse the logic.

Copy link
Member

@frenzibyte frenzibyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure about the existence of "joystick axis buttons" instead of KeyBindingContainer-level ones, but I suppose this is fine for now.

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.

3 participants