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,13 +2,19 @@ package spotify
import (
"time"
"github.com/gdamore/tcell"
)
func (widget *Widget) initializeKeyboardControls() {
widget.SetKeyboardChar("/", widget.ShowHelp, "Show/hide this help prompt")
widget.SetKeyboardChar("h", widget.previous, "Select previous item")
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widgett")
widget.SetKeyboardChar("l", widget.next, "Select next item")
widget.SetKeyboardChar("h", widget.previous, "Select previous item")
widget.SetKeyboardChar(" ", widget.playPause, "Play/pause song")
widget.SetKeyboardKey(tcell.KeyDown, widget.next, "Select next item")
widget.SetKeyboardKey(tcell.KeyUp, widget.previous, "Select previous item")
}
func (widget *Widget) previous() {