Implement axis targets, axis -> button and axis -> relative axis mappings. (#1)
Co-authored-by: Anna Rose Wiggins <annabunches@gmail.com> Co-committed-by: Anna Rose Wiggins <annabunches@gmail.com>
This commit is contained in:
parent
ff38db6596
commit
e617a6eda6
25 changed files with 903 additions and 130 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++
|
||||
}
|
||||
|
|
@ -95,7 +95,8 @@ func main() {
|
|||
case ChannelEventInput:
|
||||
switch channelEvent.Event.Type {
|
||||
case evdev.EV_SYN:
|
||||
// We've received a SYN_REPORT, so now we send all of our pending events
|
||||
// We've received a SYN_REPORT, so now we send all pending events; since SYN_REPORTs
|
||||
// might come from multiple input devices, we'll always flush, just to be sure.
|
||||
for _, buffer := range vBuffersByName {
|
||||
buffer.SendEvents()
|
||||
}
|
||||
|
|
@ -114,6 +115,8 @@ func main() {
|
|||
case ChannelEventTimer:
|
||||
// Timer events give us the device and event to use directly
|
||||
vBuffersByDevice[channelEvent.Device].AddEvent(channelEvent.Event)
|
||||
// If we get a timer event, flush the output device buffer immediately
|
||||
vBuffersByDevice[channelEvent.Device].SendEvents()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue