Emit event threaded

This commit is contained in:
2025-11-23 18:01:21 +01:00
parent 538cc8731f
commit 15ff801cb0
2 changed files with 20 additions and 3 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ use std::sync::Arc;
use osui::prelude::*;
#[derive(Debug, Clone)]
pub struct KeyPress;
impl Event for KeyPress {
@@ -18,7 +19,7 @@ fn main() {
let cx = cx.clone();
move || loop {
crossterm::event::read().unwrap();
cx.event(&KeyPress);
cx.emit_event_threaded(&KeyPress);
}
});