summaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
Diffstat (limited to 'events')
-rw-r--r--events/events.go8
-rw-r--r--events/poll.go2
2 files changed, 6 insertions, 4 deletions
diff --git a/events/events.go b/events/events.go
index 6783703..deea8ac 100644
--- a/events/events.go
+++ b/events/events.go
@@ -1,15 +1,17 @@
package events
+type Delta uint64
+
type DeviceID int
type MouseMotion struct {
Which DeviceID
Dx, Dy float32
- Delta uint64
+ Delta
}
type MousePress struct {
- Delta uint64
+ Delta
Key uint8
Which DeviceID
JustPressed, JustReleased, IsPressed bool
@@ -20,7 +22,7 @@ type WindowChange struct {
}
type KeyPress struct {
- Delta uint64
+ Delta
Key string
Which DeviceID
JustPressed, JustReleased, IsPressed bool
diff --git a/events/poll.go b/events/poll.go
index c57621e..ee4d171 100644
--- a/events/poll.go
+++ b/events/poll.go
@@ -4,7 +4,7 @@ import (
"github.com/Zyko0/go-sdl3/sdl"
)
-func Poll(delta uint64) ([]any, error) {
+func Poll(delta Delta) ([]any, error) {
var evs []any
var event sdl.Event
for sdl.PollEvent(&event) {