func (this *Listener) ButtonPressed(key int) bool { //just once if glfw.MouseButton(key) == glfw.KeyRelease { return false } _, found := this.mButtons[key] if !found { this.mButtons[key] = keyDown return true } if this.mButtons[key] == keyPressed { this.mButtons[key] = keyDown return true } return false }
// MouseButton returns true if the given mouse button btn is held down, or false otherwise. func (w *window) MouseButton(btn MouseButton) bool { if glfw.MouseButton(int(btn)) == glfw.KeyPress { return true } return false }
func (this *Listener) ButtonUp(key int) bool { return glfw.MouseButton(key) == glfw.KeyRelease }
func (this *Listener) ButtonDown(key int) bool { return glfw.MouseButton(key) == glfw.KeyPress }