Example #1
0
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
}
Example #2
0
// 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
}
Example #3
0
func (this *Listener) ButtonUp(key int) bool {
	return glfw.MouseButton(key) == glfw.KeyRelease
}
Example #4
0
func (this *Listener) ButtonDown(key int) bool {
	return glfw.MouseButton(key) == glfw.KeyPress
}