mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Harmonize keyboard controls
Make sure everyone has a refresh option Have specific ordering: - Help - Refresh - Select next - Select prev - ... Add unselect where applicable
This commit is contained in:
@@ -2,14 +2,20 @@ package spotifyweb
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/gdamore/tcell"
|
||||
)
|
||||
|
||||
func (widget *Widget) initializeKeyboardControls() {
|
||||
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
|
||||
widget.SetKeyboardChar("/", widget.Refresh, "Refresh widget")
|
||||
widget.SetKeyboardChar("h", widget.selectPrevious, "Select previous item")
|
||||
widget.SetKeyboardChar("l", widget.selectNext, "Select next item")
|
||||
widget.SetKeyboardChar(" ", widget.playPause, "Play/pause")
|
||||
widget.SetKeyboardChar("s", widget.toggleShuffle, "Toggle shuffle")
|
||||
|
||||
widget.SetKeyboardKey(tcell.KeyDown, widget.selectNext, "Select next item")
|
||||
widget.SetKeyboardKey(tcell.KeyUp, widget.selectPrevious, "Select previous item")
|
||||
}
|
||||
|
||||
func (widget *Widget) selectPrevious() {
|
||||
|
||||
Reference in New Issue
Block a user