[Android] Input overlay haptic feedback #13220
Open
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.
(I had previously opened #12970 but decided to revert the controller rumble changes as they weren't ready for merge)
Basically I added vibration when pressing the input overlay controls. This feature is disabled by default and can be enabled only if the device has a vibrator.
The vibration's intensity (duration/amplitude) and triggers (button press/release & overlay joystick) can be adjusted using the new dialog accessible via "Overlay Controls" -> "Touch Haptics".
To ensure all devices including those on Android 13+ can perceive a vibration even when haptic feedback is disabled in Android settings, I've decided to use the VibrationEffect.Composition library with automatic fallback to non-rich haptics on older devices that do not support primitive composition.
Any feedback would be appreciated, thank you for reading