added MouseWheel event function
This commit is contained in:
parent
bfed5dc792
commit
77993ea244
1 changed files with 6 additions and 0 deletions
|
@ -32,6 +32,7 @@ type Window struct {
|
||||||
MouseDown func(button, x, y int)
|
MouseDown func(button, x, y int)
|
||||||
MouseMove func(x, y int)
|
MouseMove func(x, y int)
|
||||||
MouseUp func(button, x, y int)
|
MouseUp func(button, x, y int)
|
||||||
|
MouseWheel func(x, y int)
|
||||||
KeyDown func(scancode int, rn rune, name string)
|
KeyDown func(scancode int, rn rune, name string)
|
||||||
KeyUp func(scancode int, rn rune, name string)
|
KeyUp func(scancode int, rn rune, name string)
|
||||||
KeyChar func(rn rune)
|
KeyChar func(rn rune)
|
||||||
|
@ -154,6 +155,11 @@ func (wnd *Window) StartFrame() error {
|
||||||
wnd.MouseMove(int(e.X), int(e.Y))
|
wnd.MouseMove(int(e.X), int(e.Y))
|
||||||
handled = true
|
handled = true
|
||||||
}
|
}
|
||||||
|
case *sdl.MouseWheelEvent:
|
||||||
|
if wnd.MouseWheel != nil {
|
||||||
|
wnd.MouseWheel(int(e.X), int(e.Y))
|
||||||
|
handled = true
|
||||||
|
}
|
||||||
case *sdl.KeyboardEvent:
|
case *sdl.KeyboardEvent:
|
||||||
if e.Type == sdl.KEYDOWN {
|
if e.Type == sdl.KEYDOWN {
|
||||||
if wnd.KeyDown != nil {
|
if wnd.KeyDown != nil {
|
||||||
|
|
Loading…
Reference in a new issue