joyful/internal/configparser/schema.go
Anna Rose Wiggins 2650159a81 Better deadzones (#19)
Reviewed-on: #19
Co-authored-by: Anna Rose Wiggins <annabunches@gmail.com>
Co-committed-by: Anna Rose Wiggins <annabunches@gmail.com>
2025-09-14 23:11:56 +00:00

67 lines
1.7 KiB
Go

// These types comprise the YAML schema that doesn't need custom unmarshalling.
package configparser
type Config struct {
Devices []DeviceConfig
Modes []string
Rules []RuleConfig
}
// TODO: configure custom unmarshaling so we can overload Buttons, Axes, and RelativeAxes...
type DeviceConfigVirtual struct {
Name string
Preset string
NumButtons int `yaml:"num_buttons,omitempty"`
NumAxes int `yaml:"num_axes,omitempty"`
NumRelativeAxes int `yaml:"num_rel_axes"`
Buttons []string
Axes []string
RelativeAxes []string `yaml:"rel_axes,omitempty"`
}
type RuleConfigButton struct {
Input RuleTargetConfigButton
Output RuleTargetConfigButton
}
type RuleConfigButtonCombo struct {
Inputs []RuleTargetConfigButton
Output RuleTargetConfigButton
}
type RuleConfigButtonLatched struct {
Input RuleTargetConfigButton
Output RuleTargetConfigButton
}
type RuleConfigAxis struct {
Input RuleTargetConfigAxis
Output RuleTargetConfigAxis
}
type RuleConfigAxisCombined struct {
InputLower RuleTargetConfigAxis `yaml:"input_lower,omitempty"`
InputUpper RuleTargetConfigAxis `yaml:"input_upper,omitempty"`
Output RuleTargetConfigAxis
}
type RuleConfigAxisToButton struct {
RepeatRateMin int `yaml:"repeat_rate_min,omitempty"`
RepeatRateMax int `yaml:"repeat_rate_max,omitempty"`
Input RuleTargetConfigAxis
Output RuleTargetConfigButton
}
type RuleConfigAxisToRelaxis struct {
RepeatRateMin int `yaml:"repeat_rate_min"`
RepeatRateMax int `yaml:"repeat_rate_max"`
Increment int
Input RuleTargetConfigAxis
Output RuleTargetConfigRelaxis
}
type RuleConfigModeSelect struct {
Input RuleTargetConfigButton
Output RuleTargetConfigModeSelect
}