https://github.com/jasonjmcghee/trackpad_haptic
A simple interface into controlling the mac trackpad haptic feedback from rust.
https://github.com/jasonjmcghee/trackpad_haptic
accessibility haptic haptic-feedback haptics mac macos rust trackpad
Last synced: 6 months ago
JSON representation
A simple interface into controlling the mac trackpad haptic feedback from rust.
- Host: GitHub
- URL: https://github.com/jasonjmcghee/trackpad_haptic
- Owner: jasonjmcghee
- License: mit
- Created: 2024-06-01T00:03:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-01T17:03:11.000Z (over 1 year ago)
- Last Synced: 2025-03-27T11:51:19.586Z (7 months ago)
- Topics: accessibility, haptic, haptic-feedback, haptics, mac, macos, rust, trackpad
- Language: Rust
- Homepage:
- Size: 10.7 KB
- Stars: 23
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trackpad Haptic Feedback on Mac
[](https://crates.io/crates/trackpad_haptic)
[](https://github.com/jasonjmcghee/trackpad_haptic#license)A simple interface into controlling the mac trackpad haptic feedback from rust.
I've provided an example of producing morse code.
```bash
cargo run --example morse
```## Usage
```rust
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
* [MIT License](LICENSE)