-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
filesKeys.go
47 lines (42 loc) · 1.48 KB
/
filesKeys.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package keys
import "github.com/charmbracelet/bubbles/key"
type filesKeyMap struct {
Up key.Binding
Down key.Binding
Enter key.Binding
NavigateToTorrent key.Binding
DownloadTorrent key.Binding
CopyMagnetLink key.Binding
ShowDescription key.Binding
GoBack key.Binding
Search key.Binding
Help key.Binding
Quit key.Binding
}
// ShortHelp returns keybindings to be shown in the mini help view. It's part
// of the key.Map interface.
func (k filesKeyMap) ShortHelp() []key.Binding {
return []key.Binding{k.Help, k.GoBack, k.Quit}
}
// FullHelp returns keybindings for the expanded help view. It's part of the
// key.Map interface.
func (k filesKeyMap) FullHelp() [][]key.Binding {
return [][]key.Binding{
{k.Up, k.Down, k.Enter, k.NavigateToTorrent}, // first column
{k.DownloadTorrent, k.CopyMagnetLink, k.ShowDescription}, // second column
{k.Search, k.Help, k.GoBack, k.Quit}, // third column
}
}
var FilesKeys = filesKeyMap{
Up: allKeys.Up,
Down: allKeys.Down,
Enter: allKeys.GetTorrent,
NavigateToTorrent: allKeys.NavigateToTorrent,
DownloadTorrent: allKeys.DownloadTorrent,
CopyMagnetLink: allKeys.CopyMagnetLink,
ShowDescription: allKeys.ShowDescription,
GoBack: allKeys.GoBackQEsc,
Search: allKeys.SearchS,
Help: allKeys.Help,
Quit: allKeys.CtrlC,
}