2019-08-30 17:45:27 +00:00
|
|
|
use std::thread::sleep;
|
|
|
|
use std::time::Duration;
|
|
|
|
use crate::keyboard::KeyboardBackend;
|
|
|
|
use std::sync::mpsc;
|
2019-08-30 16:32:10 +00:00
|
|
|
|
2019-08-30 17:45:27 +00:00
|
|
|
mod keyboard;
|
2019-08-30 12:33:40 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("Hello, world from Rust!");
|
|
|
|
|
2019-08-30 17:45:27 +00:00
|
|
|
let (sender, receiver) = mpsc::channel();
|
2019-08-30 16:32:10 +00:00
|
|
|
|
2019-08-30 17:45:27 +00:00
|
|
|
let keyboard = keyboard::get_backend(sender);
|
|
|
|
keyboard.initialize();
|
|
|
|
keyboard.start();
|
2019-08-30 16:32:10 +00:00
|
|
|
|
2019-08-30 17:45:27 +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
|
|
|
}
|