瀏覽代碼

main: change default keybindings

rigormorrtiss 4 年之前
父節點
當前提交
1851c7ea53
共有 2 個文件被更改,包括 10 次插入8 次删除
  1. 4 4
      README.md
  2. 6 4
      discordo.go

+ 4 - 4
README.md

@@ -34,10 +34,10 @@ sudo mv ./discordo /usr/local/bin
 
 ### Default Keybindings
 
-- `Ctrl` + `G`: Sets the focus on the guilds dropdown.
-- `Ctrl` + `J`: Sets the focus on the channels treeview.
-- `Ctrl` + `K`: Sets the focus on the messages textview.
-- `Ctrl` + `L`: Sets the focus on the message inputfield.
+- `Alt` + `1`: Sets the focus on the guilds dropdown.
+- `Alt` + `2`: Sets the focus on the channels treeview.
+- `Alt` + `3`: Sets the focus on the messages textview.
+- `Alt` + `4`: Sets the focus on the message inputfield.
 
 ### Clipboard
 

+ 6 - 4
discordo.go

@@ -2,6 +2,7 @@ package main
 
 import (
 	"context"
+	"fmt"
 	"sort"
 
 	"github.com/99designs/keyring"
@@ -77,14 +78,15 @@ func main() {
 }
 
 func onAppInputCapture(e *tcell.EventKey) *tcell.EventKey {
+	fmt.Println(e.Name(), e.Key(), e.Modifiers())
 	switch e.Name() {
-	case "Ctrl+G":
+	case "Alt+Rune[1]":
 		app.SetFocus(guildsDropDown)
-	case "Ctrl+J":
+	case "Alt+Rune[2]":
 		app.SetFocus(channelsTreeView)
-	case "Ctrl+K":
+	case "Alt+Rune[3]":
 		app.SetFocus(messagesTextView)
-	case "Ctrl+L":
+	case "Alt+Rune[4]":
 		if messageInputField != nil {
 			app.SetFocus(messageInputField)
 		}