Skip to content

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

License

Notifications You must be signed in to change notification settings

jasonjmcghee/trackpad_haptic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages