aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ttyplay/input.rs
blob: 7221f634bad5ab45de7a25340db4d93c792915cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub async fn handle_input(
    key: textmode::Key,
    event_w: async_std::channel::Sender<crate::event::Event>,
) -> anyhow::Result<()> {
    match key {
        textmode::Key::Char('q') => {
            event_w.send(crate::event::Event::Quit).await?
        }
        textmode::Key::Char(' ') => {
            event_w.send(crate::event::Event::Pause).await?;
        }
        _ => {}
    }
    Ok(())
}