github.com/wtfutil/wtf@v0.43.0/modules/digitalocean/keyboard.go (about)

     1  package digitalocean
     2  
     3  import "github.com/gdamore/tcell/v2"
     4  
     5  func (widget *Widget) initializeKeyboardControls() {
     6  	widget.InitializeHelpTextKeyboardControl(widget.ShowHelp)
     7  	widget.InitializeRefreshKeyboardControl(widget.Refresh)
     8  
     9  	widget.SetKeyboardChar("?", widget.showInfo, "Show info about the selected droplet")
    10  
    11  	widget.SetKeyboardChar("b", widget.dropletRestart, "Reboot the selected droplet")
    12  	widget.SetKeyboardChar("j", widget.Prev, "Select previous item")
    13  	widget.SetKeyboardChar("k", widget.Next, "Select next item")
    14  	widget.SetKeyboardChar("p", widget.dropletEnabledPrivateNetworking, "Enable private networking for the selected drople")
    15  	widget.SetKeyboardChar("s", widget.dropletShutDown, "Shut down the selected droplet")
    16  	widget.SetKeyboardChar("u", widget.Unselect, "Clear selection")
    17  
    18  	widget.SetKeyboardKey(tcell.KeyCtrlD, widget.dropletDestroy, "Destroy the selected droplet")
    19  	widget.SetKeyboardKey(tcell.KeyDown, widget.Next, "Select next item")
    20  	widget.SetKeyboardKey(tcell.KeyEnter, widget.showInfo, "Show info about the selected droplet")
    21  	widget.SetKeyboardKey(tcell.KeyUp, widget.Prev, "Select previous item")
    22  }