Crates.io | trackpad_haptic |
lib.rs | trackpad_haptic |
version | 0.1.1 |
source | src |
created_at | 2024-06-01 16:34:36.698302 |
updated_at | 2024-06-01 17:03:33.425394 |
description | A simple interface into controlling the mac trackpad haptic feedback |
homepage | |
repository | https://github.com/jasonjmcghee/trackpad_haptic |
max_upload_size | |
id | 1258762 |
size | 14,333 |
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
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)
);
}
}