input: Rename MouseWheel -> Wheel

This commit is contained in:
Hajime Hoshi 2018-09-30 17:01:45 +09:00
parent b6f0ea0100
commit 237f6a2014
4 changed files with 6 additions and 6 deletions

View File

@ -52,10 +52,10 @@ func CursorPosition() (x, y int) {
return ui.AdjustedCursorPosition() 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. // It returns 0 if the wheel isn't being rolled.
func MouseWheel() (xoff, yoff float64) { func Wheel() (xoff, yoff float64) {
return input.Get().MouseWheel() return input.Get().Wheel()
} }
// IsMouseButtonPressed returns a boolean indicating whether mouseButton is pressed. // IsMouseButtonPressed returns a boolean indicating whether mouseButton is pressed.

View File

@ -92,7 +92,7 @@ func (i *Input) IsMouseButtonPressed(button MouseButton) bool {
return false return false
} }
func (i *Input) MouseWheel() (xoff, yoff float64) { func (i *Input) Wheel() (xoff, yoff float64) {
i.m.RLock() i.m.RLock()
defer i.m.RUnlock() defer i.m.RUnlock()
return i.scrollX, i.scrollY return i.scrollX, i.scrollY

View File

@ -91,7 +91,7 @@ func (i *Input) IsMouseButtonPressed(button MouseButton) bool {
return false return false
} }
func (i *Input) MouseWheel() (xoff, yoff float64) { func (i *Input) Wheel() (xoff, yoff float64) {
return 0, 0 return 0, 0
// TODO: Mouse scroll functionality is not yet implemented in js // TODO: Mouse scroll functionality is not yet implemented in js
} }

View File

@ -36,7 +36,7 @@ func (i *Input) IsKeyPressed(key Key) bool {
return false return false
} }
func (i *Input) MouseWheel() (xoff, yoff float64) { func (i *Input) Wheel() (xoff, yoff float64) {
return 0, 0 return 0, 0
} }