summaryrefslogtreecommitdiff
path: root/input/input.go
diff options
context:
space:
mode:
Diffstat (limited to 'input/input.go')
-rw-r--r--input/input.go29
1 files changed, 5 insertions, 24 deletions
diff --git a/input/input.go b/input/input.go
index 48eeb02..5a0dea7 100644
--- a/input/input.go
+++ b/input/input.go
@@ -1,30 +1,11 @@
package input
-import "ponger/ecs"
+import "ponger/events"
-type DeviceID int
-
-type Event struct {
- ecs.Event
- Which DeviceID
- Dx, Dy float32
- JustPressed, JustReleased, IsPressed bool
-}
-
-type Handler interface {
- Process(ev Event)
+type MouseMotionHandler interface {
+ ProcessMouseMotion(ev events.MouseMotion)
}
-func ProcessTree(root any, ev Event) {
- if inp, ok := root.(Handler); ok {
- inp.Process(ev)
- }
- if g, ok := root.(ecs.IsGameObject); ok {
- for _, c := range g.GO().Children {
- if c == nil {
- continue
- }
- ProcessTree(c, ev)
- }
- }
+type MousePressHandler interface {
+ ProcessMousePress(ev events.MousePress)
}