split crates

This commit is contained in:
Robin Appelman 2020-04-18 15:01:10 +02:00
commit a606af713b
10 changed files with 247 additions and 1006 deletions

23
client/examples/client.rs Normal file
View file

@ -0,0 +1,23 @@
use shortcutd::{Shortcut, ShortcutClient};
use std::error::Error;
use std::time::Duration;
fn main() -> Result<(), Box<dyn Error>> {
let mut client = ShortcutClient::new()?;
let shortcut: Shortcut = "<Ctrl><Alt>-KeyP".parse()?;
client.register(shortcut, |s| {
eprintln!("shortcut1 {}", s);
})?;
let shortcut: Shortcut = "<Ctrl><Alt>-KeyO".parse()?;
client.register(shortcut, |s| {
eprintln!("shortcut2 {}", s);
})?;
loop {
client.process(Duration::from_millis(1000))?;
}
}