espanso/src/main.rs

25 lines
554 B
Rust
Raw Normal View History

use std::thread::sleep;
use std::time::Duration;
use crate::keyboard::KeyboardBackend;
use std::sync::mpsc;
2019-08-30 16:32:10 +00:00
mod keyboard;
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
let keyboard = keyboard::get_backend(sender);
keyboard.initialize();
keyboard.start();
2019-08-30 16:32:10 +00:00
loop {
match receiver.recv() {
Ok(c) => {
println!("Yeah {}",c);
},
Err(_) => panic!("Worker threads disconnected before the solution was found!"),
}
}
2019-08-30 12:33:40 +00:00
}