Add more themes and rustfmt
This commit is contained in:
28
src/event.rs
28
src/event.rs
@@ -20,23 +20,25 @@ impl EventHandler {
|
||||
let (tx, rx) = mpsc::channel();
|
||||
let _tx = tx.clone();
|
||||
|
||||
thread::spawn(move || loop {
|
||||
if event::poll(tick_rate).unwrap_or(false) {
|
||||
match event::read() {
|
||||
Ok(Event::Key(key)) => {
|
||||
if tx.send(AppEvent::Key(key)).is_err() {
|
||||
return;
|
||||
thread::spawn(move || {
|
||||
loop {
|
||||
if event::poll(tick_rate).unwrap_or(false) {
|
||||
match event::read() {
|
||||
Ok(Event::Key(key)) => {
|
||||
if tx.send(AppEvent::Key(key)).is_err() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(Event::Resize(w, h)) => {
|
||||
if tx.send(AppEvent::Resize(w, h)).is_err() {
|
||||
return;
|
||||
Ok(Event::Resize(w, h)) => {
|
||||
if tx.send(AppEvent::Resize(w, h)).is_err() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
_ => {}
|
||||
} else if tx.send(AppEvent::Tick).is_err() {
|
||||
return;
|
||||
}
|
||||
} else if tx.send(AppEvent::Tick).is_err() {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user