use crate::*; impl Handle for Sequencer { fn handle (&mut self, from: &Tui) -> Perhaps { match from.event() { // NONE, "seq_cursor_up", "move cursor up", |sequencer: &mut Sequencer| { key!(KeyCode::Up) => { match self.entered { true => { self.note_axis.point_dec(); }, false => { self.note_axis.start_dec(); }, } Ok(Some(true)) }, // NONE, "seq_cursor_down", "move cursor down", |self: &mut Sequencer| { key!(KeyCode::Down) => { match self.entered { true => { self.note_axis.point_inc(); }, false => { self.note_axis.start_inc(); }, } Ok(Some(true)) }, // NONE, "seq_cursor_left", "move cursor up", |self: &mut Sequencer| { key!(KeyCode::Left) => { match self.entered { true => { self.time_axis.point_dec(); }, false => { self.time_axis.start_dec(); }, } Ok(Some(true)) }, // NONE, "seq_cursor_right", "move cursor up", |self: &mut Sequencer| { key!(KeyCode::Right) => { match self.entered { true => { self.time_axis.point_inc(); }, false => { self.time_axis.start_inc(); }, } Ok(Some(true)) }, // NONE, "seq_mode_switch", "switch the display mode", |self: &mut Sequencer| { key!(KeyCode::Char('`')) => { self.mode = !self.mode; Ok(Some(true)) }, _ => Ok(None) } } }