diff options
| author | krolxon <krolyxon@tutanota.com> | 2024-04-25 15:51:31 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2024-04-25 15:51:31 +0530 |
| commit | a8161521d099c8add12b54db519c74f976e2a55c (patch) | |
| tree | eb33571279ce37a7ef610ded639145fa732f7cb2 /src/handler.rs | |
| parent | 00c5c12d82a2d6b9ca5f56f6ca468b2b3212c792 (diff) | |
add keymaps to readme.md and minor changes
Diffstat (limited to 'src/handler.rs')
| -rwxr-xr-x | src/handler.rs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/handler.rs b/src/handler.rs index 81a8639..15d5c49 100755 --- a/src/handler.rs +++ b/src/handler.rs @@ -2,8 +2,6 @@ use std::time::Duration; use crate::app::{App, AppResult, SelectedTab}; use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; -use mpd::{Query, Term}; -use ratatui::style::Modifier; use rust_fuzzy_search; use simple_dmenu::dmenu; @@ -13,6 +11,8 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> { KeyCode::Char('c') | KeyCode::Char('C') => { if key_event.modifiers == KeyModifiers::CONTROL { app.quit(); + } else { + app.conn.conn.clear()?; } } @@ -68,12 +68,6 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> { app.conn.pause(); } - // Clear Queue - KeyCode::Char('x') => { - app.conn.conn.clear()?; - // app.update_queue(); - } - // Dmenu prompt KeyCode::Char('D') => { app.conn.play_dmenu()?; @@ -122,22 +116,23 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> { app.selected_tab = SelectedTab::Playlists; } - - KeyCode::Char('n') => { + KeyCode::Char('>') => { app.conn.conn.next()?; } - KeyCode::Char('N') => { + KeyCode::Char('<') => { app.conn.conn.prev()?; } // Volume controls KeyCode::Char('=') => { app.conn.inc_volume(2); + app.conn.update_volume(); } KeyCode::Char('-') => { app.conn.dec_volume(2); + app.conn.update_volume(); } // Delete highlighted song from the queue |
