trackpad_haptic

Crates.iotrackpad_haptic
lib.rstrackpad_haptic
version0.1.1
sourcesrc
created_at2024-06-01 16:34:36.698302
updated_at2024-06-01 17:03:33.425394
descriptionA simple interface into controlling the mac trackpad haptic feedback
homepage
repositoryhttps://github.com/jasonjmcghee/trackpad_haptic
max_upload_size
id1258762
size14,333
Jason McGhee (jasonjmcghee)

documentation

README

Trackpad Haptic Feedback on Mac

Crates.io License

A simple interface into controlling the mac trackpad haptic feedback from rust.

I've provided an example of producing morse code.

cargo run --example morse

Usage

use trackpad_haptic::{Feedback, FeedbackManager};

fn main() {
    let haptic_manager = FeedbackManager::default();
    loop {
        // Shortest possible
        haptic_manager.trigger();
        thread::sleep(Duration::from_secs(1));

        // 1 second of continuous feedback
        let length_millis = 1000;
        let delay_millis = 1000;
        haptic_manager.trigger_with_feedback(
            Feedback::new(length_millis, delay_millis)
        );
    }
}

License

Commit count: 12

cargo fmt