Add support for clickable joysticks on game controllers, L3 and R3. #522
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(This PR obsoletes #274, which merged into a main branch. I couldn't fix it without creating a new PR altogether).
Mark the type contribution you are making:
Description
This pull request, along with pull request 56 in DeltaCore, adds support for clickable joysticks, referred to as L3 and R3. The DeltaCore PR adds the enum cases and value changed handler. This pull request adds the strings that appear controller remapping UI.
References issue #266.
Testing
List all iOS versions and devices you've tested this change on.
Checklist
General (All PRs)
Experimental Feature-specific
I couldn't find a (simple) way to gate this behind an experimental feature flag. The actual implementation changes are in the DeltaCore PR, which does not have access to
ExperimentalFeatures. There's no way to disable it from Delta itself. I tried following the stack trace throughControllerInputsViewController, but there doesn't seem to be a way to determine what input got pressed or to reject an input. If you want, I can hardcode a type checkgameController(_,didActivate:value:), and if it's.leftThumbstickButtonor.rightThumbstickButton, return early. I believe that would prevent the user from mapping the L3 and R3 buttons. However, it doesn't actually preventMFiGameControllerfrom recognizing them. I believe this satisfies the "When a feature is disabled, it should have no noticeable impact on the rest of the app" guideline.ExperimentalFeaturesstruct annotated with@Feature: see above.@Option's to persist all feature-related data: Not needed.ExperimentalFeatures.shared.[feature].isEnabledruntime check: see above.