TRACK MOUSE ACTIVITY ON THE CANVAS
canvas.addEventListener(eventType, onEventFunction, false);
Note that the canvas object is used here, not context; the event listener registration is predicated on the actual canvas element, not the Canvas API. You can now supply eventType, onEventFunction, and a Boolean, which almost always is false: This indicates that events bubble up the DOM starting at the canvas element, which is most appropriate in a mouse-activity context.
The following ...