From 586c0b88eb9b5e688a1ac9c7251106aff2ea69a5 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sat, 6 Dec 2025 16:42:44 +0100 Subject: [PATCH] Change stop key to 's' for better compatibility - Replace Shift+Space with 's' key for stop functionality - Update status bar shortcuts to reflect the change - Bump version to 0.1.5 --- Cargo.toml | 2 +- src/main.rs | 4 ++-- src/ui/mod.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2e94765..d859642 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-player" -version = "0.1.4" +version = "0.1.5" edition = "2021" [dependencies] diff --git a/src/main.rs b/src/main.rs index 90a5da2..950efb3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -227,8 +227,8 @@ async fn handle_key_event(terminal: &mut Terminal< tracing::info!("Playing: {:?} (playlist: {} tracks)", path, state.playlist.len()); } } - (KeyCode::Char(' '), KeyModifiers::SHIFT) => { - // Shift+Space: Stop playback + (KeyCode::Char('s'), _) => { + // s: Stop playback state.player_state = PlayerState::Stopped; state.current_position = 0.0; state.current_duration = 0.0; diff --git a/src/ui/mod.rs b/src/ui/mod.rs index abd6aca..babfcd1 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -251,7 +251,7 @@ fn render_status_bar(frame: &mut Frame, state: &AppState, area: Rect) { frame.render_widget(status_bar, area); } else { // Normal mode shortcuts (always shown when not in search mode) - let shortcuts = "/: Search • v: Mark • a: Add • c: Clear • Enter: Play • Space: Pause • Shift+Space: Stop • ←→: Seek • +/-: Vol • n/p: Next/Prev • r: Rescan • q: Quit"; + let shortcuts = "/: Search • v: Mark • a: Add • c: Clear • Enter: Play • Space: Pause • s: Stop • ←→: Seek • +/-: Vol • n/p: Next/Prev • r: Rescan • q: Quit"; let status_bar = Paragraph::new(shortcuts) .style(Style::default().fg(Theme::muted_text()).bg(Theme::background())) .alignment(Alignment::Center);