diff --git a/key/debug.txt b/key/debug.txt new file mode 100644 index 0000000..e69de29 diff --git a/key/key.go b/key/key.go index b6f486d..462d5e2 100644 --- a/key/key.go +++ b/key/key.go @@ -36,9 +36,7 @@ // to render help text for keystrokes in your views. package key -import ( - tea "github.com/charmbracelet/bubbletea" -) +import "fmt" // Binding describes a set of keybindings and, optionally, their associated // help text. @@ -129,7 +127,7 @@ type Help struct { } // Matches checks if the given KeyMsg matches the given bindings. -func Matches(k tea.KeyPressMsg, b ...Binding) bool { +func Matches[T fmt.Stringer](k T, b ...Binding) bool { keys := k.String() for _, binding := range b { for _, v := range binding.keys {