Add latched rules.

This commit is contained in:
Anna Rose Wiggins 2025-07-02 20:05:36 -04:00
parent a078dcb193
commit f5283f33ca
5 changed files with 91 additions and 35 deletions

View file

@ -7,21 +7,32 @@ type MappingRule interface {
OutputName() string
}
type MappingRuleBase struct {
Output RuleTarget
}
// A Simple Mapping Rule can map a button to a button or an axis to an axis.
type SimpleMappingRule struct {
MappingRuleBase
Input RuleTarget
Output RuleTarget
Name string
}
// A Combo Mapping Rule can require multiple physical button presses for a single output button
type ComboMappingRule struct {
MappingRuleBase
Inputs []RuleTarget
Output RuleTarget
Name string
State int
}
type LatchedMappingRule struct {
MappingRuleBase
Input RuleTarget
Name string
State bool
}
type RuleTarget struct {
DeviceName string
Device *evdev.InputDevice