mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
don't crash on add track/scene
This commit is contained in:
parent
5a9ec0a63d
commit
6a738375e2
9 changed files with 205 additions and 207 deletions
17
src/core.rs
17
src/core.rs
|
|
@ -148,17 +148,12 @@ pub fn input_thread (
|
|||
// Listen for events and send them to the main thread
|
||||
if ::crossterm::event::poll(poll).is_ok() {
|
||||
let event = ::crossterm::event::read().unwrap();
|
||||
match event {
|
||||
Event::Key(KeyEvent {
|
||||
code: KeyCode::Char('c'),
|
||||
modifiers: KeyModifiers::CONTROL,
|
||||
..
|
||||
}) => {
|
||||
exited.store(true, Ordering::Relaxed);
|
||||
},
|
||||
_ => if device.write().unwrap().handle(&AppEvent::Input(event)).is_err() {
|
||||
break
|
||||
}
|
||||
if let Event::Key(KeyEvent {
|
||||
code: KeyCode::Char('c'), modifiers: KeyModifiers::CONTROL, ..
|
||||
}) = event {
|
||||
exited.store(true, Ordering::Relaxed);
|
||||
} else if let Err(e) = device.write().unwrap().handle(&AppEvent::Input(event)) {
|
||||
panic!("{e}")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue