|
@@ -58,7 +58,7 @@ func main() {
|
|
|
channelsTreeView = ui.NewChannelsTreeView(channelsTreeNode, onChannelsTreeViewSelected, config.Theme)
|
|
channelsTreeView = ui.NewChannelsTreeView(channelsTreeNode, onChannelsTreeViewSelected, config.Theme)
|
|
|
messagesTextView = ui.NewMessagesTextView(onMessagesTextViewChanged, config.Theme)
|
|
messagesTextView = ui.NewMessagesTextView(onMessagesTextViewChanged, config.Theme)
|
|
|
mainFlex = ui.NewMainFlex(guildsDropDown, channelsTreeView, messagesTextView)
|
|
mainFlex = ui.NewMainFlex(guildsDropDown, channelsTreeView, messagesTextView)
|
|
|
- app = ui.NewApp()
|
|
|
|
|
|
|
+ app = ui.NewApp(onAppInputCapture)
|
|
|
|
|
|
|
|
token := util.GetPassword("token")
|
|
token := util.GetPassword("token")
|
|
|
if token != "" {
|
|
if token != "" {
|
|
@@ -76,6 +76,23 @@ func main() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func onAppInputCapture(event *tcell.EventKey) *tcell.EventKey {
|
|
|
|
|
+ switch event.Name() {
|
|
|
|
|
+ case "Ctrl+G":
|
|
|
|
|
+ app.SetFocus(guildsDropDown)
|
|
|
|
|
+ case "Ctrl+J":
|
|
|
|
|
+ app.SetFocus(channelsTreeView)
|
|
|
|
|
+ case "Ctrl+K":
|
|
|
|
|
+ app.SetFocus(messagesTextView)
|
|
|
|
|
+ case "Ctrl+L":
|
|
|
|
|
+ if messageInputField != nil {
|
|
|
|
|
+ app.SetFocus(messageInputField)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return event
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func onMessagesTextViewChanged() {
|
|
func onMessagesTextViewChanged() {
|
|
|
app.Draw()
|
|
app.Draw()
|
|
|
}
|
|
}
|