Rename input event handler to handle_events

Rename the input event handler module and function.
Update imports, re‑exports, and main.rs to use handle_events.
Add a brief doc comment for the new function.
This commit is contained in:
2026-04-06 12:20:19 +02:00
parent 30f2e17ed7
commit 0f37989f55
3 changed files with 13 additions and 13 deletions
@@ -2,7 +2,8 @@ use crate::app::threads::AppEvent;
use ratatui::crossterm::event::{Event, read};
use std::sync::mpsc::Sender;
pub fn handle_input_events(tx: Sender<AppEvent>) {
/// Reads *all* crossterm events and forwards the ones we care about.
pub fn handle_events(tx: Sender<AppEvent>) {
loop {
match read() {
Ok(ev) => match ev {
@@ -11,8 +12,8 @@ pub fn handle_input_events(tx: Sender<AppEvent>) {
break;
}
}
Event::Resize(c, r) => {
if tx.send(AppEvent::Resize(c, r)).is_err() {
Event::Resize(cols, rows) => {
if tx.send(AppEvent::Resize(cols, rows)).is_err() {
break;
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
pub mod events;
pub mod handle_input_events;
pub mod handle_events;
pub use events::AppEvent;
pub use handle_input_events::handle_input_events;
pub use handle_events::handle_events;