diff --git a/input.go b/input.go index 8658b031a..2774ec15b 100644 --- a/input.go +++ b/input.go @@ -52,10 +52,10 @@ func CursorPosition() (x, y int) { return ui.AdjustedCursorPosition() } -// MouseWheel returns the x and y offset of the scroll wheel. +// MouseWheel returns the x and y offset of the mouse wheel or touchpad scroll. // It returns 0 if the wheel isn't being rolled. -func MouseWheel() (xoff, yoff float64) { - return input.Get().MouseWheel() +func Wheel() (xoff, yoff float64) { + return input.Get().Wheel() } // IsMouseButtonPressed returns a boolean indicating whether mouseButton is pressed. diff --git a/internal/input/input_glfw.go b/internal/input/input_glfw.go index fa0a96d26..c952604ea 100644 --- a/internal/input/input_glfw.go +++ b/internal/input/input_glfw.go @@ -92,7 +92,7 @@ func (i *Input) IsMouseButtonPressed(button MouseButton) bool { return false } -func (i *Input) MouseWheel() (xoff, yoff float64) { +func (i *Input) Wheel() (xoff, yoff float64) { i.m.RLock() defer i.m.RUnlock() return i.scrollX, i.scrollY diff --git a/internal/input/input_js.go b/internal/input/input_js.go index b2c46c685..5712554dd 100644 --- a/internal/input/input_js.go +++ b/internal/input/input_js.go @@ -91,7 +91,7 @@ func (i *Input) IsMouseButtonPressed(button MouseButton) bool { return false } -func (i *Input) MouseWheel() (xoff, yoff float64) { +func (i *Input) Wheel() (xoff, yoff float64) { return 0, 0 // TODO: Mouse scroll functionality is not yet implemented in js } diff --git a/internal/input/input_mobile.go b/internal/input/input_mobile.go index 35fa2dd38..d56c88c58 100644 --- a/internal/input/input_mobile.go +++ b/internal/input/input_mobile.go @@ -36,7 +36,7 @@ func (i *Input) IsKeyPressed(key Key) bool { return false } -func (i *Input) MouseWheel() (xoff, yoff float64) { +func (i *Input) Wheel() (xoff, yoff float64) { return 0, 0 }