bevy_trackpad_haptic

Crates.iobevy_trackpad_haptic
lib.rsbevy_trackpad_haptic
version0.1.1
sourcesrc
created_at2024-06-02 18:12:34.89814
updated_at2024-06-02 18:18:14.116777
descriptionA bevy plugin for triggering trackpad haptic feedback on a mac
homepage
repositoryhttps://github.com/jasonjmcghee/bevy_trackpad_haptic
max_upload_size
id1259373
size39,308
Jason McGhee (jasonjmcghee)

documentation

README

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
Commit count: 5

cargo fmt