diff options
Diffstat (limited to 'gocui/keybindings.go')
| -rw-r--r-- | gocui/keybindings.go | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/gocui/keybindings.go b/gocui/keybindings.go index 8a4d194..79666fa 100644 --- a/gocui/keybindings.go +++ b/gocui/keybindings.go @@ -7,8 +7,8 @@ package main import ( "github.com/awesome-gocui/gocui" + "go.wit.com/lib/widget" "go.wit.com/log" - "go.wit.com/gui/widget" ) func defaultKeybindings(g *gocui.Gui) error { @@ -30,13 +30,13 @@ func defaultKeybindings(g *gocui.Gui) error { if err := g.SetKeybinding("", gocui.MouseLeft, gocui.ModMouseCtrl, ctrlDown); err != nil { return err } -// if err := g.SetKeybinding(w.v.Name(), gocui.MouseLeft, gocui.ModNone, click); err != nil { -// return err -// } + // if err := g.SetKeybinding(w.v.Name(), gocui.MouseLeft, gocui.ModNone, click); err != nil { + // return err + // } /* - if err := g.SetKeybinding("", gocui.MouseLeft, gocui.ModNone, globalDown); err != nil { - return err - } + if err := g.SetKeybinding("", gocui.MouseLeft, gocui.ModNone, globalDown); err != nil { + return err + } */ if err := g.SetKeybinding("msg", gocui.MouseLeft, gocui.ModNone, msgDown); err != nil { return err @@ -51,7 +51,7 @@ func addDebugKeys(g *gocui.Gui) { func(g *gocui.Gui, v *gocui.View) error { fakeStartWidth = me.FakeW fakeStartHeight = me.TabH + me.FramePadH - if (showDebug) { + if showDebug { me.rootNode.showFake() showDebug = false } else { @@ -59,12 +59,12 @@ func addDebugKeys(g *gocui.Gui) { showDebug = true } return nil - }) + }) // display the help menu g.SetKeybinding("", '?', gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { - if (showHelp) { + if showHelp { helplayout() showHelp = false } else { @@ -72,48 +72,48 @@ func addDebugKeys(g *gocui.Gui) { showHelp = true } return nil - }) + }) // redraw all the widgets g.SetKeybinding("", 'r', gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { - if (redoWidgets) { - redoWindows(0,0) + if redoWidgets { + redoWindows(0, 0) redoWidgets = false } else { me.rootNode.hideWidgets() redoWidgets = true } return nil - }) + }) // hide all widgets g.SetKeybinding("", 'h', gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { me.rootNode.hideWidgets() return nil - }) + }) // show all widgets g.SetKeybinding("", 's', gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { me.rootNode.showWidgets() return nil - }) + }) // list all widgets g.SetKeybinding("", 'L', gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { me.rootNode.listWidgets() return nil - }) + }) // list all widgets with positions g.SetKeybinding("", 'M', gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { me.rootNode.dumpTree(true) return nil - }) + }) // log to output window g.SetKeybinding("", 'o', gocui.ModNone, @@ -127,33 +127,33 @@ func addDebugKeys(g *gocui.Gui) { // setOutput(me.logStdout.tk) } return nil - }) + }) // exit g.SetKeybinding("", 'q', gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { standardExit() return nil - }) + }) g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { standardExit() return nil - }) + }) g.SetKeybinding("", gocui.KeyCtrlD, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { - if (showDebug) { + if showDebug { var a widget.Action a.Value = true a.ActionType = widget.EnableDebug callback <- a } return nil - }) + }) g.SetKeybinding("", gocui.KeyCtrlV, gocui.ModNone, func(g *gocui.Gui, v *gocui.View) error { return nil - }) + }) // panic g.SetKeybinding("", 'p', gocui.ModNone, @@ -161,5 +161,5 @@ func addDebugKeys(g *gocui.Gui) { standardExit() panic("forced panic in gocui") return nil - }) + }) } |
