Start implementing a channel for timer-based events.

This commit is contained in:
Anna Rose Wiggins 2025-07-03 18:11:37 -04:00
parent f12d119116
commit bf1bb868e5
2 changed files with 50 additions and 23 deletions

View file

@ -1,6 +1,10 @@
package mappingrules
import "github.com/holoplot/go-evdev"
import (
"time"
"github.com/holoplot/go-evdev"
)
type MappingRule interface {
MatchEvent(*evdev.InputDevice, *evdev.InputEvent, *string) *evdev.InputEvent
@ -32,6 +36,14 @@ type LatchedMappingRule struct {
State bool
}
// TODO: How are we going to implement this? It needs to operate on a timer...
type ProportionalAxisMappingRule struct {
MappingRuleBase
Input RuleTarget
Output RuleTarget
LastEvent time.Time
}
type RuleTarget struct {
DeviceName string
ModeSelect []string