da1.go 447 B

123456789101112131415161718
  1. package input
  2. import "github.com/charmbracelet/x/ansi"
  3. // PrimaryDeviceAttributesEvent represents a primary device attributes event.
  4. type PrimaryDeviceAttributesEvent []uint
  5. func parsePrimaryDevAttrs(csi *ansi.CsiSequence) Event {
  6. // Primary Device Attributes
  7. da1 := make(PrimaryDeviceAttributesEvent, len(csi.Params))
  8. csi.Range(func(i int, p int, hasMore bool) bool {
  9. if !hasMore {
  10. da1[i] = uint(p)
  11. }
  12. return true
  13. })
  14. return da1
  15. }