diff options
| author | ewy <ewy0@protonmail.com> | 2026-08-14 12:32:05 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-08-14 12:32:05 +0200 |
| commit | 48215d06a6cc0753a839e58c3403d34f69c250d4 (patch) | |
| tree | 3c391d8edc2e52818072a48c7e36abefeb3b7671 /events | |
| parent | bc3f852ea670e206fa3facc736a230f6b9d23920 (diff) | |
Diffstat (limited to 'events')
| -rw-r--r-- | events/events.go | 8 | ||||
| -rw-r--r-- | events/poll.go | 2 |
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) { |
