From a8161521d099c8add12b54db519c74f976e2a55c Mon Sep 17 00:00:00 2001 From: krolxon Date: Thu, 25 Apr 2024 15:51:31 +0530 Subject: add keymaps to readme.md and minor changes --- src/handler.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/handler.rs') 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 -- cgit v1.2.3