app.go 305 B

1234567891011121314
  1. package ui
  2. import (
  3. "github.com/gdamore/tcell/v2"
  4. "github.com/rivo/tview"
  5. )
  6. func NewApplication(onApplicationInputCapture func(event *tcell.EventKey) *tcell.EventKey) *tview.Application {
  7. app := tview.NewApplication().
  8. EnableMouse(true).
  9. SetInputCapture(onApplicationInputCapture)
  10. return app
  11. }