8 releases (stable)
3.1.3 | Nov 23, 2021 |
---|---|
3.1.2 | Sep 29, 2021 |
3.1.1 | Feb 15, 2021 |
3.0.0 | Jun 17, 2019 |
0.1.0 | Mar 17, 2017 |
#168 in Windows APIs
797 downloads per month
Used in 3 crates
13KB
193 lines
clipboard-master
Clipboard monitoring library.
Supported platforms
- Windows - uses dummy window to receive messages when clipboard changes;
- Linux - uses x11_clipboard
- MacOS - uses polling via
NSPasteboard::changeCount
as there is no event notification.
Clipboard Master Library
This project exports Master
struct that provides simple way to handle clipboard updates.
Example:
use clipboard_master::{Master, ClipboardHandler, CallbackResult};
use std::io;
struct Handler;
impl ClipboardHandler for Handler {
fn on_clipboard_change(&mut self) -> CallbackResult {
println!("Clipboard change happened!");
CallbackResult::Next
}
fn on_clipboard_error(&mut self, error: io::Error) -> CallbackResult {
eprintln!("Error: {}", error);
CallbackResult::Next
}
}
fn main() {
let _ = Master::new(Handler).run();
}
Dependencies
~0–355KB