(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

@ -75,7 +75,7 @@ func main() {
timerCount := 0
for _, rule := range rules {
if timedRule, ok := rule.(*mappingrules.MappingRuleAxisToButton); ok {
if timedRule, ok := rule.(mappingrules.TimedEventEmitter); ok {
go timerWatcher(timedRule, eventChannel)
timerCount++
}

View file

@ -9,7 +9,7 @@ import (
)
const (
TimerCheckIntervalMs = 250
TimerCheckIntervalMs = 1
DeviceCheckIntervalMs = 1
)
@ -28,12 +28,12 @@ func eventWatcher(device *evdev.InputDevice, channel chan<- ChannelEvent) {
}
}
func timerWatcher(rule *mappingrules.MappingRuleAxisToButton, channel chan<- ChannelEvent) {
func timerWatcher(rule mappingrules.TimedEventEmitter, channel chan<- ChannelEvent) {
for {
event := rule.TimerEvent()
if event != nil {
channel <- ChannelEvent{
Device: rule.Output.Device,
Device: rule.GetOutputDevice(),
Event: event,
Type: ChannelEventTimer,
}