Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960package tea
import ( "github.com/charmbracelet/x/ansi")
// KeyboardEnhancementsMsg is a message that gets sent when the terminal// supports keyboard enhancements.type KeyboardEnhancementsMsg struct { // Flags is a bitmask of enabled keyboard enhancement features. A non-zero // value indicates that at least we have key disambiguation support. // // See [ansi.KittyReportEventTypes] and other constants for details. // // Example: // // ```go // // The hard way // if msg.Flags&ansi.KittyReportEventTypes != 0 { // // Terminal supports reporting different key event types // } // // // The easy way // if msg.SupportsEventTypes() { // // Terminal supports reporting different key event types // } // ``` Flags int}
// SupportsKeyDisambiguation returns whether the terminal supports key// disambiguation (e.g., distinguishing between different modifier keys).func (k KeyboardEnhancementsMsg) SupportsKeyDisambiguation() bool { return k.Flags > 0}
// SupportsEventTypes returns whether the terminal supports reporting// different types of key events (press, release, and repeat).func (k KeyboardEnhancementsMsg) SupportsEventTypes() bool { return k.Flags&ansi.KittyReportEventTypes != 0}
// SupportsAlternateKeys returns whether the terminal supports reporting// alternate key codes.func (k KeyboardEnhancementsMsg) SupportsAlternateKeys() bool { return k.Flags&ansi.KittyReportAlternateKeys != 0}
// SupportsAllKeysAsEscapeCodes returns whether the terminal supports reporting// all keys as escape codes.func (k KeyboardEnhancementsMsg) SupportsAllKeysAsEscapeCodes() bool { return k.Flags&ansi.KittyReportAllKeysAsEscapeCodes != 0}
// SupportsAssociatedText returns whether the terminal supports reporting// associated text with key events.func (k KeyboardEnhancementsMsg) SupportsAssociatedText() bool { return k.Flags&ansi.KittyReportAssociatedKeys != 0}