//export handleMouseDragEvent
func handleMouseDragEvent(id unsafe.Pointer, pos C.CGPoint, pressed C.UInt32) {
	theDisplay.dispatch(uintptr(id), event.MouseMove{
		Pressed:  mouse.ButtonSet(pressed),
		Position: makePoint(pos),
	})
	theDisplay.dispatch(uintptr(id), event.MouseDrag{
		Pressed:  mouse.ButtonSet(pressed),
		Position: makePoint(pos),
	})
}
//export handleMouseUpEvent
func handleMouseUpEvent(id unsafe.Pointer, pos C.CGPoint, pressed C.UInt32, button C.UInt32, clicks C.UInt32) {
	theDisplay.dispatch(uintptr(id), event.MouseUp{
		Button:   mouse.Button(button),
		Pressed:  mouse.ButtonSet(pressed),
		Clicks:   int(clicks),
		Position: makePoint(pos),
	})
}
Exemple #3
0
func (self *View) clearMouseSelection(w driver.Window) {
	self.changeDefaultCursor(nil)

	if (self.state & viewMouseSelection) != 0 {
		self.state &= ^viewMouseSelection
		self.mouseSelectionOrigin = geom.Point{}
		self.mouseSelectionButtons = mouse.ButtonSet(0)
	}

	if self.content != nil {
		mouseSelection(w, self.content, event.MouseSelection{})
	}
}