diff options
Diffstat (limited to 'eventBindings.go')
| -rw-r--r-- | eventBindings.go | 54 |
1 files changed, 7 insertions, 47 deletions
diff --git a/eventBindings.go b/eventBindings.go index e17d9b6..eaec4d1 100644 --- a/eventBindings.go +++ b/eventBindings.go @@ -4,7 +4,6 @@ package main import ( - "fmt" "syscall" "github.com/awesome-gocui/gocui" @@ -37,8 +36,13 @@ func registerHandlers(g *gocui.Gui) { g.SetKeybinding("", 'D', gocui.ModNone, theDarkness) // 'D' toggles light/dark mode g.SetKeybinding("", 'q', gocui.ModNone, doExit) // 'q' exit g.SetKeybinding("", gocui.KeyTab, gocui.ModNone, tabCycleWindows) // '2' use this to test new ideas - g.SetKeybinding("", gocui.KeyPgup, gocui.ModNone, stdoutPgup) // Pgup scroll up the Stdout buffer - g.SetKeybinding("", gocui.KeyPgdn, gocui.ModNone, stdoutPgdn) // Pgdn scroll down the Stdout buffer + + // stdout keys + g.SetKeybinding("", gocui.KeyPgup, gocui.ModNone, stdoutPgup) // Pgup scroll up the Stdout buffer + g.SetKeybinding("", gocui.KeyPgdn, gocui.ModNone, stdoutPgdn) // Pgdn scroll down the Stdout buffer + g.SetKeybinding("", gocui.KeyHome, gocui.ModNone, stdoutHome) // Pgdn scroll down the Stdout buffer + g.SetKeybinding("", gocui.KeyArrowUp, gocui.ModNone, stdoutArrowUp) // Pgdn scroll down the Stdout buffer + g.SetKeybinding("", gocui.KeyArrowDown, gocui.ModNone, stdoutArrowDown) // Pgdn scroll down the Stdout buffer // debugging g.SetKeybinding("", '2', gocui.ModNone, theNotsure) // '2' use this to test new ideas @@ -92,24 +96,6 @@ func theDarkness(g *gocui.Gui, v *gocui.View) error { return nil } -func stdoutPgup(g *gocui.Gui, v *gocui.View) error { - me.stdout.pager -= 40 - if me.stdout.pager < 0 { - me.stdout.pager = 0 - } - tk := me.stdout.tk - tk.refreshStdout() - return nil -} - -func stdoutPgdn(g *gocui.Gui, v *gocui.View) error { - me.stdout.pager += 10 - - tk := me.stdout.tk - tk.refreshStdout() - return nil -} - func wheelsUp(g *gocui.Gui, v *gocui.View) error { log.Info("private wheels up") return nil @@ -139,32 +125,6 @@ func tabCycleWindows(g *gocui.Gui, v *gocui.View) error { return nil } -func theStdout(g *gocui.Gui, v *gocui.View) error { - me.stdout.pager = 0 - if me.stdout.outputOnTop { - if me.stdout.outputOffscreen { - me.stdout.outputOffscreen = false - log.Info(fmt.Sprintf("stdout moved off screen pager=%d len(%d)", me.stdout.pager, len(me.stdout.outputS))) - relocateStdoutOffscreen() - return nil - } else { - me.stdout.outputOffscreen = true - log.Info(fmt.Sprintf("stdout moved on screen pager=%d len(%d)", me.stdout.pager, len(me.stdout.outputS))) - } - // move the stdout window back onscreen - me.stdout.tk.relocateStdout(me.stdout.lastW, me.stdout.lastH) - me.stdout.outputOnTop = false - setThingsOnTop() - // me.baseGui.SetViewOnBottom("msg") - // setBottomBG() - } else { - me.stdout.outputOnTop = true - setThingsOnTop() - // me.baseGui.SetViewOnTop("msg") - } - return nil -} - func theShow(g *gocui.Gui, v *gocui.View) error { var w *guiWidget w = me.treeRoot.TK.(*guiWidget) |
