[skip travis] Add Home/End keys to navigate tables

This commit is contained in:
ClementTsang 2020-01-04 19:41:32 -05:00
parent 4418f956c7
commit e71e22f726
2 changed files with 8 additions and 6 deletions

View file

@ -10,11 +10,11 @@ A graphical top clone, written in Rust. Inspired by both [gtop](https://github.c
### Linux
You can install by cloning and using `cargo build --release`, or use `cargo install bottom`.
You can install by cloning and using `cargo build --release`, or use `cargo install bottom`. Other installation methods based on distros are as follows:
#### Arch Linux
You can get it from the AUR.
You can get it from the AUR by installing `bottom` from the AUR.
### Windows
@ -81,9 +81,9 @@ The compatibility of each widget and operating systems are, as of version 0.1.0,
- `Up` and `Down` scrolls through the list if the panel is a table (Temperature, Disks, Processes).
- `gg` to jump to the first entry of the current table.
- `gg` or `Home` to jump to the first entry of the current table.
- `G` (`Shift+g`) to jump to the last entry of the current table.
- `G` (`Shift+g`) or `End` to jump to the last entry of the current table.
#### Processes

View file

@ -66,7 +66,7 @@ fn main() -> error::Result<()> {
(@arg LEFT_LEGEND: -l --left_legend "Puts external chart legends on the left side rather than the default right side.")
(@arg USE_CURR_USAGE: -u --current_usage "Within Linux, sets a process' CPU usage to be based on the total current CPU usage, rather than assuming 100% usage.")
//(@arg CONFIG_LOCATION: -co --config +takes_value "Sets the location of the config file. Expects a config file in the JSON format.")
//(@arg BASIC_MODE: -b --basic "Sets bottom to basic mode, not showing graphs and only showing basic tables.")
(@arg BASIC_MODE: -b --basic "Sets bottom to basic mode, not showing graphs and only showing basic tables.")
)
.get_matches();
@ -202,7 +202,8 @@ fn main() -> error::Result<()> {
// If only a code, and no modifiers, don't bother...
match event.code {
KeyCode::Char('q') => break,
KeyCode::Char('G') => app.skip_to_last(),
KeyCode::Char('G') | KeyCode::End => app.skip_to_last(),
KeyCode::Home => app.skip_to_first(),
KeyCode::Char('h') => app.on_left(),
KeyCode::Char('l') => app.on_right(),
KeyCode::Char('k') => app.on_up(),
@ -212,6 +213,7 @@ fn main() -> error::Result<()> {
KeyCode::Char(uncaught_char) => app.on_char_key(uncaught_char),
KeyCode::Esc => app.reset(),
KeyCode::Enter => app.on_enter(),
KeyCode::Tab => {}
_ => {}
}
} else {