Skip to content

Commit

Permalink
perf: bindings expnaded
Browse files Browse the repository at this point in the history
  • Loading branch information
dsjkvf authored and 097115 committed Nov 9, 2023
1 parent 4c72dbb commit 5d9294e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn handle_keys_display_stock(keycode: KeyCode, modifiers: KeyModifiers, app: &mu
app.stocks.swap(app.current_tab, new_idx);
app.current_tab = new_idx;
}
(KeyCode::BackTab, KeyModifiers::SHIFT) => {
(KeyCode::BackTab, KeyModifiers::SHIFT) | (KeyCode::F(1), KeyModifiers::NONE) | (KeyCode::Char('j'), KeyModifiers::NONE) => {
if app.current_tab == 0 {
app.current_tab = app.stocks.len() - 1;
} else {
Expand All @@ -67,11 +67,11 @@ fn handle_keys_display_stock(keycode: KeyCode, modifiers: KeyModifiers, app: &mu
(KeyCode::Right, KeyModifiers::NONE) => {
app.stocks[app.current_tab].time_frame_up();
}
(KeyCode::Char('/'), KeyModifiers::NONE) => {
(KeyCode::Char('/'), KeyModifiers::NONE) | (KeyCode::Char('\\'), KeyModifiers::NONE) | (KeyCode::Char('a'), KeyModifiers::NONE) | (KeyCode::Char('+'), KeyModifiers::SHIFT) => {
app.previous_mode = app.mode;
app.mode = app::Mode::AddStock;
}
(KeyCode::Char('k'), KeyModifiers::NONE) => {
(KeyCode::Delete, KeyModifiers::NONE) | (KeyCode::Char('d'), KeyModifiers::NONE) => {
app.stocks.remove(app.current_tab);

if app.current_tab != 0 {
Expand Down Expand Up @@ -102,7 +102,7 @@ fn handle_keys_display_stock(keycode: KeyCode, modifiers: KeyModifiers, app: &mu
app.mode = app::Mode::ConfigureChart;
}
}
(KeyCode::Tab, KeyModifiers::NONE) => {
(KeyCode::Tab, KeyModifiers::NONE) | (KeyCode::F(2), KeyModifiers::NONE) | (KeyCode::Char('k'), KeyModifiers::NONE)=> {
if app.current_tab == app.stocks.len() - 1 {
app.current_tab = 0;
} else {
Expand Down Expand Up @@ -138,7 +138,7 @@ fn handle_keys_display_summary(keycode: KeyCode, app: &mut app::App) {
KeyCode::Char('s') => {
app.mode = app::Mode::DisplayStock;
}
KeyCode::Char('/') => {
KeyCode::Char('/') | KeyCode::Char('\\') | KeyCode::Char('a') | KeyCode::Char('+') => {
app.previous_mode = app.mode;
app.mode = app::Mode::AddStock;
}
Expand Down

0 comments on commit 5d9294e

Please sign in to comment.