Skip to content

Commit

Permalink
feat(app): add 'Q' key to exit application
Browse files Browse the repository at this point in the history
- Add KeyCode::Char('q') to the list of keys that trigger application exit
  • Loading branch information
ShenMian committed Jan 5, 2025
1 parent 958f327 commit b311718
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ impl App {

async fn handle_key_events(&mut self, event: KeyEvent) -> Result<()> {
match event.code {
// Exit application on `ESC`
KeyCode::Esc => {
// Exit application on `Q` or `ESC`
KeyCode::Char('q') | KeyCode::Esc => {
self.request_exit();
}
// Exit application on `Ctrl-C`
Expand Down

0 comments on commit b311718

Please sign in to comment.