refactor: consistently handle key events
This commit is contained in:
parent
effe882849
commit
9f79852e47
1 changed files with 9 additions and 7 deletions
16
discordo.go
16
discordo.go
|
|
@ -76,13 +76,15 @@ func main() {
|
|||
}
|
||||
|
||||
func onAppInputCapture(e *tcell.EventKey) *tcell.EventKey {
|
||||
switch e.Name() {
|
||||
case "Alt+Rune[1]":
|
||||
app.SetFocus(guildsTreeView)
|
||||
case "Alt+Rune[2]":
|
||||
app.SetFocus(messagesTextView)
|
||||
case "Alt+Rune[3]":
|
||||
app.SetFocus(messageInputField)
|
||||
if e.Modifiers() == tcell.ModAlt {
|
||||
switch e.Rune() {
|
||||
case '1':
|
||||
app.SetFocus(guildsTreeView)
|
||||
case '2':
|
||||
app.SetFocus(messagesTextView)
|
||||
case '3':
|
||||
app.SetFocus(messageInputField)
|
||||
}
|
||||
}
|
||||
|
||||
return e
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue