Skip to content

Commit

Permalink
add q keybinding to quit
Browse files Browse the repository at this point in the history
  • Loading branch information
pythops committed Jul 29, 2024
1 parent 464cb29 commit cd508af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ This will produce an executable file at `target/release/bluetui` that you can co

`esc`: Dismiss the help pop-up.

`ctrl+c`: Quit the app.
`ctrl+c` or `q`: Quit the app.

### Adapters

Expand Down
4 changes: 4 additions & 0 deletions src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ pub async fn handle_key_events(
}
}

KeyCode::Char('q') => {
app.quit();
}

// Show help
KeyCode::Char('?') => {
app.focused_block = FocusedBlock::Help;
Expand Down
2 changes: 1 addition & 1 deletion src/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Help {
"Start/Stop scanning",
),
(Cell::from("?").bold(), "Show help"),
(Cell::from("ctrl+c").bold(), "Quit"),
(Cell::from("ctrl+c or q").bold(), "Quit"),
(Cell::from(""), ""),
(
Cell::from("## Adapters").style(Style::new().bold().fg(Color::Yellow)),
Expand Down

0 comments on commit cd508af

Please sign in to comment.