add tui
This commit is contained in:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user