Переглянути джерело

Remove Application InputCapture handler

rigormorrtiss 4 роки тому
батько
коміт
bd63810b91
2 змінених файлів з 3 додано та 9 видалено
  1. 1 5
      discordo.go
  2. 2 4
      ui/app.go

+ 1 - 5
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()
 }

+ 2 - 4
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
 }