Add ability to change modes via rules.
This commit is contained in:
parent
8fafe3d27c
commit
034d2a8718
4 changed files with 27 additions and 10 deletions
|
@ -109,6 +109,11 @@ func makeLatchedRule(ruleConfig RuleConfig, pDevs map[string]*evdev.InputDevice,
|
|||
func makeRuleTarget(targetConfig RuleTargetConfig, devs map[string]*evdev.InputDevice) (mappingrules.RuleTarget, error) {
|
||||
ruleTarget := mappingrules.RuleTarget{}
|
||||
|
||||
if len(targetConfig.ModeSelect) > 0 {
|
||||
ruleTarget.ModeSelect = targetConfig.ModeSelect
|
||||
return ruleTarget, nil
|
||||
}
|
||||
|
||||
device, ok := devs[targetConfig.Device]
|
||||
if !ok {
|
||||
return mappingrules.RuleTarget{}, fmt.Errorf("couldn't build rule due to non-existent device '%s'", targetConfig.Device)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue