Cross-platform haptic feedback for mobile devices. More...
| Header: | #include <HapticFeedback> |
| Since: | 1.0 |
| enum class | FeedbackType { Click, Success, Warning, Selection } |
HapticFeedback provides static methods to trigger device vibrations on Android and iOS. Falls back to no-op on desktop platforms. Supports different feedback intensities for click, success, warning.
See also FeedbackType.
This enum gives the kind of haptic event to play. On Android, each kind maps to a vibration length. On other platforms trigger() does nothing, whatever the kind.
| Constant | Value | Description |
|---|---|---|
HapticFeedback::FeedbackType::Click | 0 | A light tap for a button press: 10 ms on Android. |
HapticFeedback::FeedbackType::Success | 1 | A positive confirmation: 30 ms on Android. |
HapticFeedback::FeedbackType::Warning | 2 | An alert or a warning: 50 ms on Android. |
HapticFeedback::FeedbackType::Selection | 3 | The lightest tap, for a change of selection: 5 ms on Android. |