Skip to content

Commit

Permalink
Log Mouse and Resize events.
Browse files Browse the repository at this point in the history
  • Loading branch information
matta committed Jun 23, 2024
1 parent aa660ba commit 4fce3ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ pub fn run(save_name: &Path) -> Result<()> {
terminal_input::Event::Key(key_event) => {
handle_key_event(&mut state, key_event);
}
terminal_input::Event::Tick
| terminal_input::Event::Mouse(_)
| terminal_input::Event::Resize(_, _) => {}
terminal_input::Event::Mouse(event) => {
debug!("Mouse({:#?})", event);
}
terminal_input::Event::Tick => {}
terminal_input::Event::Resize(width, height) => {
debug!("Resize({}, {})", width, height);
}
}

match &state.current_screen {
Expand Down
2 changes: 0 additions & 2 deletions src/terminal_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ pub enum Event {
/// Key press.
Key(event::KeyEvent),
/// Mouse click/scroll.
#[allow(dead_code)]
Mouse(event::MouseEvent),
/// Terminal resize.
#[allow(dead_code)]
Resize(u16, u16),
}

Expand Down

0 comments on commit 4fce3ab

Please sign in to comment.