This commit is contained in:
2026-08-27 15:24:18 +01:00
parent a2afce3f8d
commit 3ea14b91c0
10 changed files with 812 additions and 4 deletions
+29
View File
@@ -0,0 +1,29 @@
package tui
import (
tea "charm.land/bubbletea/v2"
)
func isQuit(msg tea.KeyPressMsg) bool {
s := msg.String()
return s == "q" || s == "ctrl+c" || s == "esc"
}
func isNavigateDown(msg tea.KeyPressMsg) bool {
s := msg.String()
return s == "down" || s == "j" || s == "tab"
}
func isNavigateUp(msg tea.KeyPressMsg) bool {
s := msg.String()
return s == "up" || s == "k" || s == "shift+tab"
}
func isActivate(msg tea.KeyPressMsg) bool {
s := msg.String()
return s == "enter" || s == " "
}
func isSubmit(msg tea.KeyPressMsg) bool {
return msg.String() == "enter"
}