Skip to content

Commit

Permalink
feat(console-wallet): shift+tab to go to prev tab
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Jan 25, 2022
1 parent 8efd2e4 commit bbcac60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions applications/tari_console_wallet/src/ui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ impl<B: Backend> App<B> {
}
}

pub fn on_backtab(&mut self) {
self.tabs.previous();
}

pub fn on_up(&mut self) {
self.tabs.on_up(&mut self.app_state);
}
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_console_wallet/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ fn crossterm_loop(mut app: App<CrosstermBackend<Stdout>>) -> Result<(), ExitCode
})? {
Event::Input(event) => match (event.code, event.modifiers) {
(KeyCode::Char(c), KeyModifiers::CONTROL) => app.on_control_key(c),
(KeyCode::Char(c), _) => app.on_key(c),
(KeyCode::Left, _) => app.on_left(),
(KeyCode::Up, _) => app.on_up(),
(KeyCode::Right, _) => app.on_right(),
Expand All @@ -122,6 +121,7 @@ fn crossterm_loop(mut app: App<CrosstermBackend<Stdout>>) -> Result<(), ExitCode
(KeyCode::Backspace, _) => app.on_backspace(),
(KeyCode::Enter, _) => app.on_key('\n'),
(KeyCode::Tab, _) => app.on_key('\t'),
(KeyCode::BackTab, _) => app.on_backtab(),
(KeyCode::F(10), _) => app.on_f10(),
_ => {},
},
Expand Down

0 comments on commit bbcac60

Please sign in to comment.