• OctoMY API
  • OctoMY API Reference
  • C++ Classes
  • OctoMY
  • HapticFeedback
  • HapticFeedback Class

    Cross-platform haptic feedback for mobile devices. More...

    Header: #include <HapticFeedback>
    Since: 1.0

    Public Types

    enum class FeedbackType { Click, Success, Warning, Selection }

    Detailed Description

    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.

    Member Type Documentation

    enum class HapticFeedback::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.

    ConstantValueDescription
    HapticFeedback::FeedbackType::Click0A light tap for a button press: 10 ms on Android.
    HapticFeedback::FeedbackType::Success1A positive confirmation: 30 ms on Android.
    HapticFeedback::FeedbackType::Warning2An alert or a warning: 50 ms on Android.
    HapticFeedback::FeedbackType::Selection3The lightest tap, for a change of selection: 5 ms on Android.