pub fn handle_user_input() -> Option<UserInput> {
    match read_key_press()? {
        Key::Char('m') => Some(UserInput::Mute),
        Key::Char(' ') => Some(UserInput::Pause),
        Key::Char('q') => Some(UserInput::Stop),
        Key::Char('h') | Key::Left => Some(UserInput::SeekBackward),
        Key::Char('j') | Key::Down => Some(UserInput::Next),
        Key::Char('k') | Key::Up => Some(UserInput::Prev),
        Key::Char('l') | Key::Right => Some(UserInput::SeekForward),
        _ => None,
    }
}
/// Interprets user key presses as `UserInput` variants.
Interprets user key presses as `UserInput` variants.
Interprets user key presses as ` UserInput ` variants .
pub fn handle_user_input() -> Option<UserInput> {
    match read_key_press()? {
        Key::Char('m') => Some(UserInput::Mute),
        Key::Char(' ') => Some(UserInput::Pause),
        Key::Char('q') => Some(UserInput::Stop),
        Key::Char('h') | Key::Left => Some(UserInput::SeekBackward),
        Key::Char('j') | Key::Down => Some(UserInput::Next),
        Key::Char('k') | Key::Up => Some(UserInput::Prev),
        Key::Char('l') | Key::Right => Some(UserInput::SeekForward),
        _ => None,
    }
}
pub fn handle_user_input ( ) -> Option < UserInput > { match read_key_press ( ) ? { Key :: Char ( 'm' ) => Some ( UserInput :: Mute ) , Key :: Char ( ' ' ) => Some ( UserInput :: Pause ) , Key :: Char ( 'q' ) => Some ( UserInput :: Stop ) , Key :: Char ( 'h' ) | Key :: Left => Some ( UserInput :: SeekBackward ) , Key :: Char ( 'j' ) | Key :: Down => Some ( UserInput :: Next ) , Key :: Char ( 'k' ) | Key :: Up => Some ( UserInput :: Prev ) , Key :: Char ( 'l' ) | Key :: Right => Some ( UserInput :: SeekForward ) , _ => None , } }
Interprets user key presses as `UserInput` variants.
Interprets user key presses as ` UserInput ` variants .