-
Notifications
You must be signed in to change notification settings - Fork 3
/
keybinds.go
58 lines (45 loc) · 1.4 KB
/
keybinds.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
48
49
50
51
52
53
54
55
56
57
58
package main
import (
"github.com/jroimartin/gocui"
)
func keybinds(g *gocui.Gui) error {
// Quit
if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {
return err
}
// Next View
if err := g.SetKeybinding(ServersView, gocui.KeyTab, gocui.ModNone, nextView); err != nil {
return err
}
// Next View
if err := g.SetKeybinding(FXServerCmdView, gocui.KeyTab, gocui.ModNone, nextView); err != nil {
return err
}
// Cursor up
if err := g.SetKeybinding(ServersView, gocui.KeyArrowUp, gocui.ModNone, cursorUp); err != nil {
return err
}
// Cursor down
if err := g.SetKeybinding(ServersView, gocui.KeyArrowDown, gocui.ModNone, cursorDown); err != nil {
return err
}
// Side enter
if err := g.SetKeybinding(ServersView, gocui.KeyEnter, gocui.ModNone, onSideEnter); err != nil {
return err
}
// Command enter
if err := g.SetKeybinding(FXServerCmdView, gocui.KeyEnter, gocui.ModNone, executeCommand); err != nil {
return err
}
/* I need to add some better functionality for this. Config files for now.
if err := g.SetKeybinding("side", 'n', gocui.ModNone, newProfileNameView); err != nil {
return err
}
if err := g.SetKeybinding("profile_name", gocui.KeyEnter, gocui.ModNone, newProfilePathView); err != nil {
return err
}
if err := g.SetKeybinding("profile_path", gocui.KeyEnter, gocui.ModNone, saveNewProfile); err != nil {
return err
} */
return nil
}