espanso/src/main.rs

22 lines
486 B
Rust
Raw Normal View History

use std::thread::sleep;
use std::time::Duration;
use std::sync::mpsc;
2019-08-30 19:24:03 +00:00
use crate::keyboard::KeyboardInterceptor;
use crate::keyboard::KeyboardSender;
use crate::matcher::Matcher;
2019-08-30 16:32:10 +00:00
mod keyboard;
2019-08-30 19:24:03 +00:00
mod matcher;
2019-08-30 12:33:40 +00:00
fn main() {
println!("Hello, world from Rust!");
let (sender, receiver) = mpsc::channel();
2019-08-30 16:32:10 +00:00
2019-08-30 19:24:03 +00:00
let (interceptor, sender) = keyboard::get_backend(sender);
interceptor.initialize();
interceptor.start();
2019-08-30 16:32:10 +00:00
2019-08-30 19:24:03 +00:00
let matcher = Matcher{receiver};
matcher.watch();
2019-08-30 12:33:40 +00:00
}