(WIP) Implement axis-to-relaxis repeats; similar to buttons but for discretized relative axis inputs. (i.e. mousewheel)
This commit is contained in:
parent
8bbb84da85
commit
0915ea059a
10 changed files with 224 additions and 18 deletions
|
@ -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++
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue