Skip to content

Commit 5d9294e

Browse files
dsjkvf097115
authored andcommitted
perf: bindings expnaded
1 parent 4c72dbb commit 5d9294e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/event.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn handle_keys_display_stock(keycode: KeyCode, modifiers: KeyModifiers, app: &mu
5454
app.stocks.swap(app.current_tab, new_idx);
5555
app.current_tab = new_idx;
5656
}
57-
(KeyCode::BackTab, KeyModifiers::SHIFT) => {
57+
(KeyCode::BackTab, KeyModifiers::SHIFT) | (KeyCode::F(1), KeyModifiers::NONE) | (KeyCode::Char('j'), KeyModifiers::NONE) => {
5858
if app.current_tab == 0 {
5959
app.current_tab = app.stocks.len() - 1;
6060
} else {
@@ -67,11 +67,11 @@ fn handle_keys_display_stock(keycode: KeyCode, modifiers: KeyModifiers, app: &mu
6767
(KeyCode::Right, KeyModifiers::NONE) => {
6868
app.stocks[app.current_tab].time_frame_up();
6969
}
70-
(KeyCode::Char('/'), KeyModifiers::NONE) => {
70+
(KeyCode::Char('/'), KeyModifiers::NONE) | (KeyCode::Char('\\'), KeyModifiers::NONE) | (KeyCode::Char('a'), KeyModifiers::NONE) | (KeyCode::Char('+'), KeyModifiers::SHIFT) => {
7171
app.previous_mode = app.mode;
7272
app.mode = app::Mode::AddStock;
7373
}
74-
(KeyCode::Char('k'), KeyModifiers::NONE) => {
74+
(KeyCode::Delete, KeyModifiers::NONE) | (KeyCode::Char('d'), KeyModifiers::NONE) => {
7575
app.stocks.remove(app.current_tab);
7676

7777
if app.current_tab != 0 {
@@ -102,7 +102,7 @@ fn handle_keys_display_stock(keycode: KeyCode, modifiers: KeyModifiers, app: &mu
102102
app.mode = app::Mode::ConfigureChart;
103103
}
104104
}
105-
(KeyCode::Tab, KeyModifiers::NONE) => {
105+
(KeyCode::Tab, KeyModifiers::NONE) | (KeyCode::F(2), KeyModifiers::NONE) | (KeyCode::Char('k'), KeyModifiers::NONE)=> {
106106
if app.current_tab == app.stocks.len() - 1 {
107107
app.current_tab = 0;
108108
} else {
@@ -138,7 +138,7 @@ fn handle_keys_display_summary(keycode: KeyCode, app: &mut app::App) {
138138
KeyCode::Char('s') => {
139139
app.mode = app::Mode::DisplayStock;
140140
}
141-
KeyCode::Char('/') => {
141+
KeyCode::Char('/') | KeyCode::Char('\\') | KeyCode::Char('a') | KeyCode::Char('+') => {
142142
app.previous_mode = app.mode;
143143
app.mode = app::Mode::AddStock;
144144
}

0 commit comments

Comments
 (0)