(WIP) Implement axis-to-relaxis repeats; similar to buttons but for discretized relative axis inputs. (i.e. mousewheel)

This commit is contained in:
Anna Rose Wiggins 2025-07-15 00:46:07 -04:00
parent 8bbb84da85
commit 0915ea059a
10 changed files with 224 additions and 18 deletions

View file

@ -1,11 +1,20 @@
package mappingrules
import "github.com/holoplot/go-evdev"
import (
"time"
"github.com/holoplot/go-evdev"
)
type MappingRule interface {
MatchEvent(RuleTargetDevice, *evdev.InputEvent, *string) (*evdev.InputDevice, *evdev.InputEvent)
}
type TimedEventEmitter interface {
TimerEvent() *evdev.InputEvent
GetOutputDevice() *evdev.InputDevice
}
// RuleTargets represent either a device input to match on, or an output to produce.
// Some RuleTarget types may work via side effects, such as RuleTargetModeSelect.
type RuleTarget interface {
@ -39,4 +48,5 @@ type RuleTargetDevice interface {
const (
AxisValueMin = int32(-32768)
AxisValueMax = int32(32767)
NoNextEvent = time.Duration(-1)
)