diff --git a/sdlcanvas/sdlcanvas.go b/sdlcanvas/sdlcanvas.go index a87a5db..3809029 100644 --- a/sdlcanvas/sdlcanvas.go +++ b/sdlcanvas/sdlcanvas.go @@ -32,6 +32,7 @@ type Window struct { MouseDown func(button, x, y int) MouseMove func(x, y int) MouseUp func(button, x, y int) + MouseWheel func(x, y int) KeyDown func(scancode int, rn rune, name string) KeyUp func(scancode int, rn rune, name string) KeyChar func(rn rune) @@ -154,6 +155,11 @@ func (wnd *Window) StartFrame() error { wnd.MouseMove(int(e.X), int(e.Y)) handled = true } + case *sdl.MouseWheelEvent: + if wnd.MouseWheel != nil { + wnd.MouseWheel(int(e.X), int(e.Y)) + handled = true + } case *sdl.KeyboardEvent: if e.Type == sdl.KEYDOWN { if wnd.KeyDown != nil {