From cd03d732b1f0df6c020a94135db2db4b690a4937 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 25 Jan 2021 14:54:51 +0530 Subject: handle cursor events and entry --- src/app/impl_view.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/app/impl_view.rs') diff --git a/src/app/impl_view.rs b/src/app/impl_view.rs index 395cac4..0ec47f1 100644 --- a/src/app/impl_view.rs +++ b/src/app/impl_view.rs @@ -95,6 +95,24 @@ impl View for App { self.set_focus(Absolute::Down); return EventResult::Consumed(None); } + + Event::Char('w') => { + self.move_cursor(Absolute::Up); + return EventResult::Consumed(None); + } + Event::Char('a') => { + self.move_cursor(Absolute::Left); + return EventResult::Consumed(None); + } + Event::Char('s') => { + self.move_cursor(Absolute::Down); + return EventResult::Consumed(None); + } + Event::Char('d') => { + self.move_cursor(Absolute::Right); + return EventResult::Consumed(None); + } + Event::Char('v') => { if self.habits.is_empty() { return EventResult::Consumed(None); -- cgit v1.2.3