func (c *Canvas) createEventFuncs() map[string]func(event js.Value) {
	mousePP := new(pixelPosition)
	touchPP := new(pixelPosition)
	funcs := map[string]func(event js.Value){
		"mousedown": func(event js.Value) {
			c.moveStart(mousePP.fromMouse(event))
		},
		"mouseup": func(event js.Value) {
			c.moveEnd(mousePP.fromMouse(event))
		},
		"mousemove": func(event js.Value) {
			c.moveCursor(mousePP.fromMouse(event))
		},
		"touchstart": func(event js.Value) {
			c.moveStart(touchPP.fromTouch(event))
		},
		"touchend": func(event js.Value) {
			// the event has no touches, use previous touchPos
			c.moveEnd(*touchPP)
		},
		"touchmove": func(event js.Value) {
			c.moveCursor(touchPP.fromTouch(event))
		},
	}
	return funcs
}
// createEventFuncs creates the event listener functions for mouse/touch interaction.
createEventFuncs creates the event listener functions for mouse/touch interaction.
// createEventFuncs creates the event listener functions for mouse / touch interaction .
func (c *Canvas) createEventFuncs() map[string]func(event js.Value) {
	mousePP := new(pixelPosition)
	touchPP := new(pixelPosition)
	funcs := map[string]func(event js.Value){
		"mousedown": func(event js.Value) {
			c.moveStart(mousePP.fromMouse(event))
		},
		"mouseup": func(event js.Value) {
			c.moveEnd(mousePP.fromMouse(event))
		},
		"mousemove": func(event js.Value) {
			c.moveCursor(mousePP.fromMouse(event))
		},
		"touchstart": func(event js.Value) {
			c.moveStart(touchPP.fromTouch(event))
		},
		"touchend": func(event js.Value) {
			c.moveEnd(*touchPP)
		},
		"touchmove": func(event js.Value) {
			c.moveCursor(touchPP.fromTouch(event))
		},
	}
	return funcs
}
func ( c * Canvas ) createEventFuncs ( ) map [ string ] func ( event js . Value ) { mousePP := new ( pixelPosition ) touchPP := new ( pixelPosition ) funcs := map [ string ] func ( event js . Value ) { " " : func ( event js . Value ) { c . moveStart ( mousePP . fromMouse ( event ) ) } , " " : func ( event js . Value ) { c . moveEnd ( mousePP . fromMouse ( event ) ) } , " " : func ( event js . Value ) { c . moveCursor ( mousePP . fromMouse ( event ) ) } , " " : func ( event js . Value ) { c . moveStart ( touchPP . fromTouch ( event ) ) } , " " : func ( event js . Value ) { c . moveEnd ( * touchPP ) } , " " : func ( event js . Value ) { c . moveCursor ( touchPP . fromTouch ( event ) ) } , } return funcs }
createEventFuncs creates the event listener functions for mouse/touch interaction.
createEventFuncs creates the event listener functions for mouse / touch interaction .
// the event has no touches, use previous touchPos