mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
refactor: compact
This commit is contained in:
parent
abee6cc2c8
commit
60627ac3e5
43 changed files with 923 additions and 780 deletions
|
|
@ -89,8 +89,17 @@ impl Engine {
|
|||
if event::poll(poll).is_ok() {
|
||||
let event = event::read().unwrap();
|
||||
let mut state = state.lock().unwrap();
|
||||
if state.handle(&Event::Input(event)).is_err() {
|
||||
break
|
||||
match event {
|
||||
crossterm::event::Event::Key(crossterm::event::KeyEvent {
|
||||
code: KeyCode::Char('c'),
|
||||
modifiers: KeyModifiers::CONTROL,
|
||||
..
|
||||
}) => {
|
||||
state.exit()
|
||||
},
|
||||
_ => if state.handle(&crate::engine::Event::Input(event)).is_err() {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue