slight re-structure

This commit is contained in:
2025-06-26 07:13:41 +02:00
parent 8274afff04
commit f363bbdae1
6 changed files with 97 additions and 70 deletions
+7 -8
View File
@@ -1,14 +1,13 @@
use crossterm::event::{KeyCode, KeyModifiers};
use crate::{event_manager::EventManager, Close, Event, Extension, Screen};
use crate::{
event,
events::{Close, EventManager},
extensions::Extension,
Screen,
};
#[derive(Clone)]
pub struct KeyPress(pub crossterm::event::KeyEvent);
impl Event for KeyPress {
fn as_any(self: Box<Self>) -> Box<dyn std::any::Any> {
self
}
}
event!(KeyPress(pub crossterm::event::KeyEvent));
pub trait KeyPressEventHandler {
fn on_keypress(&mut self, event: KeyPress);