From bd63810b919ccd0da8b1bf09eb97bdb3ba34d860 Mon Sep 17 00:00:00 2001 From: rigormorrtiss Date: Wed, 28 Jul 2021 20:08:23 +0400 Subject: [PATCH] Remove Application InputCapture handler --- discordo.go | 6 +----- ui/app.go | 6 ++---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/discordo.go b/discordo.go index 98a03df..a9add44 100644 --- a/discordo.go +++ b/discordo.go @@ -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() } diff --git a/ui/app.go b/ui/app.go index 1b078d0..8218a13 100644 --- a/ui/app.go +++ b/ui/app.go @@ -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 }