Skip to content

A bevy plugin for triggering trackpad haptic feedback on a mac

License

Notifications You must be signed in to change notification settings

jasonjmcghee/bevy_trackpad_haptic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
        )
    );
}

Compatibility

bevy bevy_trackpad_haptic
0.13 0.1

License

Releases

No releases published

Packages

No packages published

Languages