mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-07 22:17:07 +02:00
big flat; add midi/audio port handling
This commit is contained in:
parent
66ac2bcbb6
commit
c0d6d0174e
16 changed files with 1086 additions and 315 deletions
10
src/exit.rs
10
src/exit.rs
|
|
@ -1,5 +1,5 @@
|
|||
use crate::*;
|
||||
use std::sync::{Arc, atomic::AtomicBool};
|
||||
use crate::Usually;
|
||||
|
||||
#[derive(Clone)] pub struct Exit(Arc<AtomicBool>);
|
||||
|
||||
|
|
@ -7,6 +7,14 @@ impl Exit {
|
|||
pub fn run <T> (run: impl FnOnce(Self)->Usually<T>) -> Usually<T> {
|
||||
run(Self(Arc::new(AtomicBool::new(false))))
|
||||
}
|
||||
pub fn is (event: &Event) -> bool {
|
||||
matches!(event, Event::Key(KeyEvent {
|
||||
modifiers: KeyModifiers::CONTROL,
|
||||
code: KeyCode::Char('c'),
|
||||
kind: KeyEventKind::Press,
|
||||
state: KeyEventState::NONE
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<Arc<AtomicBool>> for Exit {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue