mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip: big flat pt.3, testing standalone tui
This commit is contained in:
parent
a5628fb663
commit
cb680ab096
4 changed files with 189 additions and 139 deletions
|
|
@ -1,6 +1,11 @@
|
|||
use crate::*;
|
||||
use std::sync::{Arc, Mutex, RwLock};
|
||||
|
||||
/// Handle input
|
||||
pub trait Handle<E: Engine>: Send + Sync {
|
||||
fn handle (&mut self, context: &E::Input) -> Perhaps<E::Handled>;
|
||||
}
|
||||
|
||||
/// Current input state
|
||||
pub trait Input<E: Engine> {
|
||||
/// Type of input event
|
||||
|
|
@ -23,11 +28,6 @@ pub trait Input<E: Engine> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Handle input
|
||||
pub trait Handle<E: Engine>: Send + Sync {
|
||||
fn handle (&mut self, context: &E::Input) -> Perhaps<E::Handled>;
|
||||
}
|
||||
|
||||
impl<E: Engine, H: Handle<E>> Handle<E> for &mut H {
|
||||
fn handle (&mut self, context: &E::Input) -> Perhaps<E::Handled> {
|
||||
(*self).handle(context)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue