#feedback #mac #bevy #haptic #bevy-plugin #trackpad #triggering

bevy_trackpad_haptic

A bevy plugin for triggering trackpad haptic feedback on a mac

2 releases

0.1.1 Jun 2, 2024
0.1.0 Jun 2, 2024

#894 in Game dev

MIT license

12KB
52 lines

bevy_trackpad_haptic

Crates.io License

A bevy plugin for triggering trackpad haptic feedback on a mac.

I also maintain its core dependency trackpad_feedback.

Try out the example:

cargo run --example simple

Usage

fn main() {
    App::new()
        .add_plugins((MinimalPlugins, TrackpadHapticPlugin))
        .add_systems(Update, important_system)
        .run();
}

// Everything important

fn important_system(mut feedback_event_writer: EventWriter<FeedbackEvent>) {
    // Something happens like damage to the player!
    feedback_event_writer.send(
        FeedbackEvent::new(
            // length in millis
            100,
            // minimum delay before additional feedback
            0
        )
    );
}

License

bevy bevy_trackpad_haptic
0.13 0.1

Dependencies

~31–58MB
~1M SLoC