Add hat to RuleType parser.

This commit is contained in:
Anna Rose Wiggins 2025-09-15 13:35:28 -04:00
parent 57a634b882
commit 42a1759961
2 changed files with 5 additions and 0 deletions

View file

@ -54,6 +54,10 @@ func (dc *RuleConfig) UnmarshalYAML(unmarshal func(data interface{}) error) erro
config := RuleConfigModeSelect{} config := RuleConfigModeSelect{}
err = unmarshal(&config) err = unmarshal(&config)
dc.Config = config dc.Config = config
case RuleTypeHat:
config := RuleConfigHat{}
err = unmarshal(&config)
dc.Config = config
} }
return err return err

View file

@ -18,6 +18,7 @@ const (
RuleTypeAxisToButton RuleType = "axis-to-button" RuleTypeAxisToButton RuleType = "axis-to-button"
RuleTypeAxisToRelaxis RuleType = "axis-to-relaxis" RuleTypeAxisToRelaxis RuleType = "axis-to-relaxis"
RuleTypeModeSelect RuleType = "mode-select" RuleTypeModeSelect RuleType = "mode-select"
RuleTypeHat RuleType = "hat"
) )
var ( var (