Remove Application InputCapture handler

This commit is contained in:
rigormorrtiss 2021-07-28 20:08:23 +04:00
parent 8b3f11175a
commit bd63810b91
2 changed files with 3 additions and 9 deletions

View file

@ -48,7 +48,7 @@ func main() {
channelsList = ui.NewChannelsList(onChannelsListSelected)
messagesTextView = ui.NewMessagesTextView(onMessagesTextViewChanged)
mainFlex = ui.NewMainFlex(guildsDropDown, channelsList, messagesTextView)
app = ui.NewApp(onAppInputCapture)
app = ui.NewApp()
token := util.GetPassword("token")
if token != "" {
@ -66,10 +66,6 @@ func main() {
}
}
func onAppInputCapture(event *tcell.EventKey) *tcell.EventKey {
return event
}
func onLoginFormQuitButtonSelected() {
app.Stop()
}

View file

@ -1,14 +1,12 @@
package ui
import (
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)
func NewApp(onAppInputCapture func(event *tcell.EventKey) *tcell.EventKey) (app *tview.Application) {
func NewApp() (app *tview.Application) {
app = tview.NewApplication().
EnableMouse(true).
SetInputCapture(onAppInputCapture)
EnableMouse(true)
return
}