diff options
Diffstat (limited to 'src/bin/ttyplay/input.rs')
-rw-r--r-- | src/bin/ttyplay/input.rs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/bin/ttyplay/input.rs b/src/bin/ttyplay/input.rs index 0da0c8b..a922a55 100644 --- a/src/bin/ttyplay/input.rs +++ b/src/bin/ttyplay/input.rs @@ -1,13 +1,23 @@ pub fn to_event(key: &textmode::Key) -> Option<crate::event::Event> { Some(match key { textmode::Key::Char('g' | '0' | ')') => { - crate::event::Event::FirstFrame + crate::event::Event::TimerAction( + crate::event::TimerAction::FirstFrame, + ) } - textmode::Key::Char('G' | '$') => crate::event::Event::LastFrame, - textmode::Key::Char('l' | 'n') => crate::event::Event::NextFrame, - textmode::Key::Char('h' | 'p') => crate::event::Event::PreviousFrame, + textmode::Key::Char('G' | '$') => crate::event::Event::TimerAction( + crate::event::TimerAction::LastFrame, + ), + textmode::Key::Char('l' | 'n') => crate::event::Event::TimerAction( + crate::event::TimerAction::NextFrame, + ), + textmode::Key::Char('h' | 'p') => crate::event::Event::TimerAction( + crate::event::TimerAction::PreviousFrame, + ), textmode::Key::Char('q') => crate::event::Event::Quit, - textmode::Key::Char(' ') => crate::event::Event::Pause, + textmode::Key::Char(' ') => { + crate::event::Event::TimerAction(crate::event::TimerAction::Pause) + } textmode::Key::Ctrl(b'i') => crate::event::Event::ToggleUi, _ => return None, }) |