()
| 45 | } |
| 46 | |
| 47 | func (s *KeyboardMacroStep) Validate() error { |
| 48 | if len(s.Keys) > MaxKeysPerStep { |
| 49 | return fmt.Errorf("too many keys in step (max %d)", MaxKeysPerStep) |
| 50 | } |
| 51 | |
| 52 | if s.Delay < MinStepDelay { |
| 53 | s.Delay = MinStepDelay |
| 54 | } else if s.Delay > MaxStepDelay { |
| 55 | s.Delay = MaxStepDelay |
| 56 | } |
| 57 | |
| 58 | return nil |
| 59 | } |
| 60 | |
| 61 | type KeyboardMacro struct { |
| 62 | ID string `json:"id"` |