1
0
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:
Sean Smith
2019-05-12 19:00:17 -04:00
parent 3eb3183249
commit a2f5db7847
20 changed files with 76 additions and 56 deletions

View File

@@ -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() {