da1.go 433 B

123456789101112131415161718
  1. package input
  2. import "github.com/charmbracelet/x/ansi"
  3. // PrimaryDeviceAttributesEvent is an event that represents the terminal
  4. // primary device attributes.
  5. type PrimaryDeviceAttributesEvent []int
  6. func parsePrimaryDevAttrs(params ansi.Params) Event {
  7. // Primary Device Attributes
  8. da1 := make(PrimaryDeviceAttributesEvent, len(params))
  9. for i, p := range params {
  10. if !p.HasMore() {
  11. da1[i] = p.Param(0)
  12. }
  13. }
  14. return da1
  15. }