diff --git a/README.md b/README.md index c951c81e..a9a0a70e 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ when searching processes. - `f` to freeze the screen from updating with new data. Press `f` again to unfreeze. Note that monitoring will still continue in the background. -- `Ctrl-Up` or `Ctrl-k`, `Ctrl-Down` or `Ctrl-j`, `Ctrl-Left` or `Ctrl-h`, `Ctrl-Right` or `Ctrl-l` to navigate between widgets. +- `Ctrl/Shift-Up`, `Ctrl/Shift-Down`, `Ctrl/Shift-Left`, and `Ctrl/Shift-Right` to navigate between widgets. - `Esc` to close a dialog window. diff --git a/src/canvas.rs b/src/canvas.rs index 58d8a09e..321d9ddd 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -38,7 +38,7 @@ lazy_static! { Text::raw("Ctrl-r to reset all data.\n"), Text::raw("f to toggle freezing and unfreezing the display.\n"), Text::raw( - "Ctrl-Up or Ctrl-k, Ctrl-Down or Ctrl-j, Ctrl-Left or Ctrl-h, Ctrl-Right or Ctrl-l to navigate between widgets.\n" + "Ctrl/Shift-Up, Ctrl/Shift-Down, Ctrl/Shift-Left, and Ctrl/Shift-Right to navigate between widgets.\n" ), Text::raw("Up or k and Down or j scrolls through a list.\n"), Text::raw("Esc to close a dialog window (help or dd confirmation).\n"), diff --git a/src/main.rs b/src/main.rs index c328f6f0..90454c1c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -253,10 +253,10 @@ fn main() -> error::Result<()> { match event.code { KeyCode::Char('c') => break, KeyCode::Char('f') => app.enable_searching(), - KeyCode::Left | KeyCode::Char('h') => app.move_left(), - KeyCode::Right | KeyCode::Char('l') => app.move_right(), - KeyCode::Up | KeyCode::Char('k') => app.move_up(), - KeyCode::Down | KeyCode::Char('j') => app.move_down(), + KeyCode::Left => app.move_left(), + KeyCode::Right => app.move_right(), + KeyCode::Up => app.move_up(), + KeyCode::Down => app.move_down(), KeyCode::Char('p') => app.search_with_pid(), KeyCode::Char('n') => app.search_with_name(), KeyCode::Char('r') => { @@ -264,11 +264,18 @@ fn main() -> error::Result<()> { app.reset(); } } - // TODO: [SEARCH] Rename "simple" search to just... search without cases... KeyCode::Char('a') => app.skip_cursor_beginning(), KeyCode::Char('e') => app.skip_cursor_end(), _ => {} } + } else if let KeyModifiers::SHIFT = event.modifiers { + match event.code { + KeyCode::Left => app.move_left(), + KeyCode::Right => app.move_right(), + KeyCode::Up => app.move_up(), + KeyCode::Down => app.move_down(), + _ => {} + } } }