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