Implement config generator for AxisToButton. Use RuleTargetDevice interface more broadly.
This commit is contained in:
parent
e93187b8a5
commit
ed2627e113
9 changed files with 28 additions and 16 deletions
|
@ -1,7 +1,6 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
|
@ -134,13 +133,22 @@ func makeMappingRuleAxis(ruleConfig RuleConfig,
|
|||
return mappingrules.NewMappingRuleAxis(base, input, output), nil
|
||||
}
|
||||
|
||||
// STUB
|
||||
func makeMappingRuleAxisToButton(ruleConfig RuleConfig,
|
||||
pDevs map[string]*evdev.InputDevice,
|
||||
vDevs map[string]*evdev.InputDevice,
|
||||
base mappingrules.MappingRuleBase) (*mappingrules.MappingRuleAxisToButton, error) {
|
||||
|
||||
return nil, errors.New("stub: makeMappingRuleAxisToButton")
|
||||
input, err := makeRuleTargetAxis(ruleConfig.Input, pDevs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
output, err := makeRuleTargetButton(ruleConfig.Output, vDevs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return mappingrules.NewMappingRuleAxisToButton(base, input, output, ruleConfig.RepeatRateMin, ruleConfig.RepeatRateMax), nil
|
||||
}
|
||||
|
||||
func makeMappingRuleModeSelect(ruleConfig RuleConfig,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue