Keybindings for controlling MPD

devel
~erin 2023-03-21 23:27:44 -04:00
parent 701345de29
commit e7fcad9049
Signed by: erin
GPG Key ID: 9A8E308CEFA37A47
2 changed files with 13 additions and 4 deletions

View File

@ -6,6 +6,17 @@ A simple `TUI` and commandline client for `mpd`.
- Modern features such as album art, scrobbling, notifications, etc.
- Simple configuration via a `TOML` file, and commandline options
## Keybindings
`p` - Toggle play/pause
`s` - Stop
`i` - Insert mode (search)
`<esc>` - Return to normal mode
`q` - Quit
## API (WIP)
### Commandline Options
`-h/--help` - Print help options
@ -24,7 +35,3 @@ A simple `TUI` and commandline client for `mpd`.
`play` - Start/resume playing
`pause` - Pause playing
`queue` - Print off queue
`info` - Print current song information

View File

@ -118,6 +118,8 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, mut app: App, tick_rate: Dura
KeyCode::Char('h') => app.items.unselect(),
KeyCode::Char('j') => app.items.next(),
KeyCode::Char('k') => app.items.previous(),
KeyCode::Char('p') => app.mpd_client.toggle_pause().unwrap(),
KeyCode::Char('s') => app.mpd_client.stop().unwrap(),
KeyCode::Char('i') => app.input_mode = InputMode::Editing,
_ => {}
},