Checkpoint

This commit is contained in:
maze authored and maze committed 2026-10-29 17:29:41 +01:00
1 parent 85a9ec684c
commit c5d6137fab
160 files changed
+76293 -387

No files matched your search

+27 -1
View File
@@ -1,12 +1,16 @@
package hardware
import "time"
import (
"fmt"
"time"
)
type Input interface {
Events() <-chan InputEvent
}
type InputEvent interface {
String() string
}
type (
@@ -19,10 +23,32 @@ type (
RotaryPressEvent struct {
Time time.Time
Input Input
Code int
}
RotaryLongPressEvent struct {
Time time.Time
Input Input
Code int
}
)
func (e RotaryEvent) String() string {
return fmt.Sprintf("rotary event delta=%d", e.Delta)
}
type RotaryHandler interface {
Rotary(event RotaryEvent)
}
func (e RotaryPressEvent) String() string {
return "rotary press"
}
type RotaryPressHandler interface {
RotaryPress(event RotaryPressEvent)
}
func (e RotaryLongPressEvent) String() string {
return "rotary long press"
}