Add (semi-experimental) support for multiple deadzones and deadzones that emit a fixed value.

This commit is contained in:
Anna Rose Wiggins 2025-09-14 18:47:48 -04:00
parent 8a903e0703
commit 2e8c2c5404
8 changed files with 246 additions and 178 deletions

View file

@ -0,0 +1,33 @@
package configparser
type RuleTargetConfigButton struct {
Device string
Button string
Inverted bool
}
type RuleTargetConfigAxis struct {
Device string
Axis string
Inverted bool
Deadzones []DeadzoneConfig
}
type DeadzoneConfig struct {
Center int32 `yaml:"center,omitempty"`
Size int32 `yaml:"size,omitempty"`
SizePercent int32 `yaml:"size_percent,omitempty"`
Start int32 `yaml:"start,omitempty"`
End int32 `yaml:"end,omitempty"`
Emit bool `yaml:"emit,omitempty"`
Value int32 `yaml:"emit_value,omitempty"`
}
type RuleTargetConfigRelaxis struct {
Device string
Axis string
}
type RuleTargetConfigModeSelect struct {
Modes []string
}

View file

@ -65,29 +65,3 @@ type RuleConfigModeSelect struct {
Input RuleTargetConfigButton
Output RuleTargetConfigModeSelect
}
type RuleTargetConfigButton struct {
Device string
Button string
Inverted bool
}
type RuleTargetConfigAxis struct {
Device string
Axis string
DeadzoneCenter int32 `yaml:"deadzone_center,omitempty"`
DeadzoneSize int32 `yaml:"deadzone_size,omitempty"`
DeadzoneSizePercent int32 `yaml:"deadzone_size_percent,omitempty"`
DeadzoneStart int32 `yaml:"deadzone_start,omitempty"`
DeadzoneEnd int32 `yaml:"deadzone_end,omitempty"`
Inverted bool
}
type RuleTargetConfigRelaxis struct {
Device string
Axis string
}
type RuleTargetConfigModeSelect struct {
Modes []string
}